摘要: 一、加载xib文件用例:在类TestOjbect中加载test.xib文件[[NSBundle mainBundle] loadNibNamed:@"test"owner:selfoptions:nil];当owner是self时,test.xib的基类必须继承自TestOjbect(owner是什么对象,则test.xib必须继承该对象,或该对象的子类)上面的方法返回xib中对外公开的对象的数组(NSArray)二、加载其他文件用例:加载app包中的content.plist文件NSString *path = [[NSBundle mainBundle] pathFor 阅读全文
posted @ 2012-04-16 22:57 月光的尽头 阅读(640) 评论(0) 推荐(0)
摘要: 判断运行在那种设备上:UI_USER_INTERFACE_IDIOM()UI_USER_INTERFACE_IDIOM() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] ? [[UIDevice currentDevice] userInterfaceIdiom] : UIUserInterfaceIdiomPhone)定义在UIKit库的UIDevice.h中,(ios3.2以下的系统中没有userInterfaceIdiom属性,所以用这宏判断)(UIUserInterfaceIdi 阅读全文
posted @ 2012-04-16 22:24 月光的尽头 阅读(866) 评论(0) 推荐(0)