2012年4月27日
摘要: iphone中常用@protocol和delegate的机制来实现接口的功能例如想在A的功能要在B中实现,可以在A中定义一个Protocol,按照Cocoa的习惯,一般它以delegate结尾,熟悉C#的同学应该知道它的意义。其实不论是接口,委托,还是回调函数,本质上都做了一件事情。就是定义了一个操作契约,然后由用户自己来实现它的具体内容@protocolAViewControllerDelegate-(void)func1-(int)func2:(int)arg @end然后要在A中声明一个delegate:@property (weak, nonatomic) id<AViewCon 阅读全文
posted @ 2012-04-27 21:21 老Zhan 阅读(1261) 评论(0) 推荐(0) 编辑
摘要: 在使用core Data时出现如题 错误,已在项目中加入了Coredata.framework,最终在stackoverflow上找到答案,原来要在App_Prefix.pch 中加入#import <CoreData/CoreData.h>问题解决!http://stackoverflow.com/questions/2032818/adding-core-data-to-existing-iphone-project 阅读全文
posted @ 2012-04-27 01:25 老Zhan 阅读(3093) 评论(0) 推荐(0) 编辑
摘要: From:http://hxsdit.com/1622 Core Data是一个Cocoa框架,用于为管理对象图提供基础实现,以及为多种文件格式的持久化提供支持。管理对象图包含的工作如撤销(undo)和重做(redo)、有效性检查、以及保证对象关系的完整性等。对象的持久化意味着Core Data可以将模型对象保存到持久化存储中,并在需要的时候将它们取出。Core Data应用程序的持久化存储(也就是对象数据的最终归档形式)的范围可以从XML文件到SQL数据库。Core Data用在关系数据库的前端应用程序是很理想的,但是所有的Cocoa应用程序都可以利用它的能力。 Core Dat... 阅读全文
posted @ 2012-04-27 00:46 老Zhan 阅读(12468) 评论(1) 推荐(2) 编辑
摘要: Where a managed object context comes from is entirely application-dependent. In a Cocoa document-based application usingNSPersistentDocument, the persistent document typically creates the context, and gives you access to it through themanagedObjectContextmethod.In a single-window application, if you 阅读全文
posted @ 2012-04-27 00:16 老Zhan 阅读(734) 评论(0) 推荐(0) 编辑