Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

高亦乐 #4

wants to merge 4 commits into from

Conversation

stevenyvette
Copy link

No description provided.

@yimingtang yimingtang added the ios label Jul 4, 2017
@yimingtang
Copy link
Member

yimingtang commented Jul 4, 2017

大概看了一下,基本功能应该有了。考虑到之前没啥 iOS 开发基础,如果独立做到这种程度应该可以了。不过给人感觉是直接照抄了人家的代码。运行时竟然要塞个东西到用户目录下,这等于不可用啊。

几个点忍不住提一下:review 了前面几个文件,你看的这份代码纰漏很多,误人子弟,不要学。

@interface JWDetailViewController : UIViewController

//文本, 备忘录内容
@property (nonatomic, strong) NSString *detail;
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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;//标记文本是否更改过
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这年头很少有人用这种语法了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants