斯坦福大学公开课IOS 7 (1)
ios 架构
core OS Core Services Media Cocoa TouchCore 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 初学
//Card.h#import <Foundation/NSObject.h>//#import <Foundation/Foundation.h>//#import Foundation;@interface Card : NSObject//默认object-c会自动创建getter与setter@property {strong ,nonatomic} NSString * contents;@property {nonatomic} BOOL chosen;@property {nonatomic} BOOL matched;//方法默认命名 getter->matched setter->setMatched //方法重命名 @property {nonatomic,getter=isMatched} BOOL matched;- (int ) match:(Card *)card; - (int ) matchs:(NSArray *)card; @end
//Card.m#import "Card.h"//私有属性或方法的声明,主要用于属性@interface Card()@end//灭有synthsize你将无法创建card实例,而且它没有名,你无法再getter和setter中引用它//实际上这些代码是看不到的,object-c会自动创建@synthesize contents = _contents;@synthesize chosen = _chosen;@synthesize matched = _matched;//- (NNString *)contents 是一个方法声明// - 表示这是一个方法- (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