Stanford iOS Handout Courseware Summary One

Source: Internet
Author: User

1, introduction of files,

#import <Foundation/Foundation.h>

IOS7 can be written in this way @import Foundation;

2, introduced in. h file is common, in. m files are referred to this class is private. Private property Declaration

@interface Card()

Declare it in this area

@property (Strong) nsstring *contents;

@end

3,strong is to save the object in memory, week instead, these two words describe the object.

4,nonatomic, does not involve multi-threading, no locks, so hurry a little.

5, the system default Set,get method.

@synthesize contents = _contents;

-(NSString *) Contents

{

return _contents;

}

-(void) setcontents: (nsstring *) Contents

{

_contents = contents;

}

6,@property (nonatomic) BOOL chosen; Non-object types do not have to be described by strong or week.

7,@property (nonatomic, Getter=ischosen) BOOL chosen; Change the value method name.

8,-(int) match: (card *) Card; override initialization method.

9, the initialization method can also pass parameters.

-(int) match: (nsarray *) othercards

{

int score = 0;

If ([card.contents isequaltostring:self. Contents]) {

score = 1;

}

return score;

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.