-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
高亦乐 #4
base: master
Are you sure you want to change the base?
高亦乐 #4
Conversation
大概看了一下,基本功能应该有了。考虑到之前没啥 iOS 开发基础,如果独立做到这种程度应该可以了。不过给人感觉是直接照抄了人家的代码。运行时竟然要塞个东西到用户目录下,这等于不可用啊。 几个点忍不住提一下:review 了前面几个文件,你看的这份代码纰漏很多,误人子弟,不要学。 |
@interface JWDetailViewController : UIViewController | ||
|
||
//文本, 备忘录内容 | ||
@property (nonatomic, strong) NSString *detail; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一般来说,这里应当用 copy
关键字
//文本, 备忘录内容 | ||
@property (nonatomic, strong) NSString *detail; | ||
//顶部,创建时间 | ||
@property (nonatomic, strong) NSString *createTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名上,首先 createTime
会让人误认为是时间类型,很显然你这里是字符串类型。其次,词性,created
嘛。
//顶部,创建时间 | ||
@property (nonatomic, strong) UILabel *timeLabel; | ||
//UITextView | ||
@property (nonatomic, strong) UITextView *textView; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view controller 里的 view 以可写属性暴露给外面太危险了。。。
//UITextView | ||
@property (nonatomic, strong) UITextView *textView; | ||
//实现UpdateMemoProtocol协议的代理,上一级的viewController | ||
@property (nonatomic) id<UpdateMemoProtocol> delegate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delegate 一般要 weak 吧,不然会循环应用
// 需要实现UITextViewDelegate和UIAlertViewDelegate协议 | ||
@interface JWDetailViewController () <UITextViewDelegate,UIAlertViewDelegate> { | ||
|
||
bool textHasChanged;//标记文本是否更改过 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这年头很少有人用这种语法了。
No description provided.