斯坦福大学公开课IOS 7 (1)
ios 架构
- core OS
- Core Services
- Media
- Cocoa Touch
Core OS
OSX Kernel(Unix OS), Power Management, Mach 3.0 ,Keychain Access ,基于BSD(Unix OS) ,Certificates.Sockets,File System,Security ,Bonjour
Core Servives
Collections,Core Location, Address Book , Net Services , Networking , Threading ,File Access, Preferences,SQLite ,URL Utilities
Media
Core Audio, JPEG PNG TIFF, OpenAL,PDF, Audio Mixing, Quartz(2D),Audio Recording,Core Animation, Video Playback,OpenGL ES
Cocoa Touch
Multi-Touch , Alerts, Core Motion, Web View,View Hierarchy, Map Kit, Locaization, Image Picker,Contrals, Camera
MVC
Objective-C 初学
#import <Foundation/NSObject.h>
@interface Card : NSObject
@property {strong ,nonatomic} NSString * contents;
@property {nonatomic} BOOL chosen;
@property {nonatomic} BOOL matched;
- (int ) match:(Card *)card;
- (int ) matchs:(NSArray *)card;
@end
#import "Card.h"
@interface Card()
@end
@synthesize contents = _contents;
@synthesize chosen = _chosen;
@synthesize matched = _matched;
- (NNString *)contents{
return _contents;
}
- (void)setContents:(NNString *contents){
_contents = contents;
}
- (BOOL) chosen
{
return _chosen;
}
- (void) setChosen:(BOOL chosen){
_chosen = chosen;
}
- (BOOL) matched{
return _matched;
}
-(void )setMatched:(BOOL matched){
_matched = matched;
}
@implementation Card
- (int )match:(Card *)card{
int score = 0;
if([card.contents isEqualToString:self.contents]){
score=1;
}
return score;
}
- (int )matchs:(NSArray *)otherCards{
int score = 0;
for(Card * card in otherCards){
if([card.contents isEqualToString:self.contents]){
score=1;
}
}
return score;
}
@end
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)