摘要: 1 #import 2 #import "AppDelegate.h" 3 4 int main(int argc, char * argv[]) { 5 6 @try { 7 // 抛出一个自定义异常 8 @throw [NSException ex... 阅读全文
posted @ 2015-11-28 18:43 金胖胖 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 可以通过 isKindOfClass 判断对象的类型 1 @interface A : NSObject 2 3 @end 4 @implementation A 5 6 @end 7 //// 8 @interface AA : A 9 10 @end11 @implementation AA... 阅读全文
posted @ 2015-11-28 18:33 金胖胖 阅读(756) 评论(0) 推荐(0) 编辑
摘要: ios设计模式中的委托Delegate官方文档解释如下:Delegation is a simple and powerful pattern in which one object in a program acts on behalf of, or in coordination with, a... 阅读全文
posted @ 2015-11-28 17:42 金胖胖 阅读(1048) 评论(0) 推荐(0) 编辑
摘要: Objective-C 协议类似于java语言中的接口新建文件步骤:Objective-C File ---> File Type = "Protocol"@protocol 1 // 协议 相当于C++语言中的接口 2 @protocol IPeople 3 -(int)getAge; 4 -(... 阅读全文
posted @ 2015-11-28 16:51 金胖胖 阅读(401) 评论(0) 推荐(0) 编辑