摘要: %@ Object%d, %i signed int%u unsigned int%f float/double%x, %X hexadecimal int%o octal int%zu size_t%p pointer%e float/double (in scientific notation)%g float/double (as %f or %e, depending on value)%s C string (bytes)%S C string (unichar)%.*s Pascal string (... 阅读全文
posted @ 2012-02-29 11:17 进劲 阅读(123) 评论(0) 推荐(0) 编辑
摘要: sortUsingSelector is an instance method of NSMutableArrayWhat should the structure of a function be when it will be called by sortUsingSelector:?The method selector you pass in should specify a method that returns an NSComparisonResult? (either NSOrderedAscending?, NSOrderedSame?, or NSOrderedDescen 阅读全文
posted @ 2012-02-21 13:57 进劲 阅读(985) 评论(0) 推荐(0) 编辑
摘要: @property是一个属性访问声明,扩号内支持以下几个属性:1,getter=getterName,setter=setterName,设置setter与getter的方法名, readonly in the case of setter=2,readwrite,readonly,设置可供访问级别2,assign,setter方法直接赋值,不进行任何retain操作,为了解决原类型与环循引用问题3,retain,setter方法对参数进行release旧值再retain新值,所有实现都是这个顺序(CC上有相关资料)4,copy,setter方法进行Copy操作,与retain处理流程一样,先 阅读全文
posted @ 2012-02-15 11:20 进劲 阅读(112) 评论(0) 推荐(0) 编辑
摘要: -(id) variable{return (varibale)}-(void)setVariable:(object)newVariable{ [newVariable retain]; [variable release]; variable=newVariable;}-(Trie *) tireAtIndex:(int) index{Tire *tire;tire=[tires objectAtIndex:index];return (tire);}-(void)setTire:(Tire *)tire (int) atIndex{[Tires replaceObjectAt... 阅读全文
posted @ 2012-02-14 14:08 进劲 阅读(268) 评论(0) 推荐(0) 编辑
摘要: self 指的就是类本身,返回的是class 的地址[[self alloc]init]使用[self.]程序会使用对象的内存管理方法,通过内存管理来占用,释放对内存的占用,直接使用variable=a,很容易造成内存的泄漏,所以推荐使用self.varibale=b.当然也有列外,在初始化和释放内存的时候,应当直接使用varibale;比如 variable=[NSArray v];或者[variable release]1,实例方法里面的self,是对象的首地址。2,类方法里面的self,是Class.尽管在同一个类里面的使用self,但是self却有着不同的解读。在类方法里面的self, 阅读全文
posted @ 2012-02-14 14:01 进劲 阅读(330) 评论(0) 推荐(0) 编辑