Skip to content

一些小建议#1

Merged
ChenYilong merged 1 commit intoChenYilong:masterfrom
zhuli8com:patch-1
Aug 8, 2015
Merged

一些小建议#1
ChenYilong merged 1 commit intoChenYilong:masterfrom
zhuli8com:patch-1

Conversation

@zhuli8com
Copy link
Copy Markdown
Contributor

问题1:初始化中的int有无必要改成NSUInteger。

问题2:CYLUser *copy = [[[self copy] allocWithZone:zone]
initWithName:_name
age:_age
sex:sex];sex从何而来?
问题3:- (void)setName:(NSString *)name {
if (_name!=name) {
//[_name release];
_name = [name copy];
}
}苹果这样干是不是效率会高一些?

问题1:初始化中的int有无必要改成NSUInteger。

问题2:CYLUser *copy = [[[self copy] allocWithZone:zone] 
                     initWithName:_name
                                  age:_age
                                  sex:sex];sex从何而来?
问题3:- (void)setName:(NSString *)name {
		if (_name!=name) {
		//[_name release];
		_name = [name copy];
	    }
	}苹果这样干是不是效率会高一些?
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

spelling error:replace copyWithZooe to copyWithZone

@ChenYilong
Copy link
Copy Markdown
Owner

spelling mistake

ChenYilong added a commit that referenced this pull request Aug 8, 2015
spelling error:replace copyWithZooe to copyWithZone
@ChenYilong ChenYilong merged commit af14040 into ChenYilong:master Aug 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants