iPhone 开发教程(斯坦福大学)

iPhone 开发教程(斯坦福大学)

5 (4人评价)
  • 课时:(28)

  • 学员:(670)

  • 浏览:(29424)

  • 加入课程
  • 如何创建你自己的定制类的笔记

    @interface Person : NSObject{    NSString *name;    int age;}- (NSString *)name; //get method- (void)setName:(NSString *)value;- (int) age; //get method;- (void)setAge:(int)age;- (BOOL)canLegallyVote;//another way to creat property//property declarations@property int age;@property (copy) NSString *name;@property (readonly) BOOL canLegallyVote; - (void)castBallot;@end // implementation file@implementation Person;- (int) age {return age;}- (void)setAge:(int) value{    age=value; } - (NSString *) name {return name;}- (void)setName:(NSString *) value{    name=value;} //calling method- (BOOL)canLegallyVote {     return (self age>=18);}//antoher way to write it@synthesize age;@synthesize name;- (BOOL)canLegallyVote{    return(age >18);}   - (void)castBallot {   if([self canLegallyVote]){     //do voting stuff}else {    NSLog(@"I'm not allowed to vote yet!");}}}   @end // Autoreleasing example- (NSString *)fullName{      NSString *result;      result=[[NSString alloc] initWithFormat:"%@ %@" , firstName, lastName];      [result autorelease];       return result;}   

  • 基础入门的笔记

    ihpone SDKMAC OS 10.5http://tinyurl.com/cs193p-2010注册证书http://cs193p.stanford.eduhttp://developer.apple.comhttp://devforums.apple.comhttp://cs193.comcocoaSDKTOOLS:Xcode开发工具interface BuilderFramworks Foundation UIKit  

  • 各种基础的类,功能,对象和实例的介绍的笔记

    Class is a blueprint for instances.Instance: a specific allocation of a classMethod: a function that an object knows how to performInstance Variable(or ''ivar"): a specific piece of data belonging to an object.Encapsulation: keep implementation private and separate from interfacePolymorphism: different objects, same interfaceInheritance: hierarchical organization, share code, customize or extend behaviors.Objective-CStrict superset of CMix C with ObjCOr even C++ with ObjC (usually referrend to as ObjC++)A very simple language, but some new syntaxSingle inheritance, classes inherit from one and only one superclassProtocols define behavior that cross classesDynamic runtimeLoosely typed, if you'd likeClasses and ObjectsClasses declare state and behaviorState (data) is maintained using instance variablesBehavior is implemented using methodsInstance variables typically hidden Accessible only using getter/setter methodsDot Syntaxconvenient shorthand for invoking accessor methodsfloat height = [person height];foat height = person.height;[person setHeight:newHeight];person.height = newHeight;[[person child] setHeight:newHeight];// exactly the same asperson.child.height = newHeight;Dynamic and static typingDynamically-typed object              id anObjectStatically-typed object      Person *anObject Objects represented in format strings using %@ 

  • 基础入门的笔记

    文档及作业下载:http://www.stanford.edu/class/cs193p/cgi-bin/drupal/downloads-2011-fall

  • 基础入门的笔记

    UIkit 用户界面portable miciphone SDK

你感兴趣的课程

移动开发 IOS开发入门教程
17万+浏览/ 7238学员/ 4.1评分
免费
7万+浏览/ 803学员/ 4.8评分
免费
6万+浏览/ 241学员/ 4评分
免费