iPhone开发常用小技巧

来源:互联网 发布:理解linux内核 编辑:程序博客网 时间:2024/05/18 00:53

一、开启文件共享

添加Info.plist字段Application supports iTunes file sharing,设为yes


二、如何在NSMutableDictionary中放入NSInteger

NSMutableDictionary中只能放入对象,不能放入基本类型,这一点请参考java的Map系列。。。 然则NSInteger。。不是对象。。。。NSNumber才是,所以应该这样放的: 
NSInteger aInteger;
NSMutableDictionary *dic=[[NSMutableDictionary alloc] initWithCapacity:10]; 
[dic setObject:[NSNumber numberWithInteger:aInteger] forKey:@"TheKey"];


原创粉丝点击