IOS-NSDictionary
2015-08-23 19:30
302 查看
#import
int main(int argc, const char * argv[])
{
//可变字典
NSMutableDictionary * set = [[NSMutableDictionary alloc]init];
[set setValue:@"shdf"forKeyPath:@"1"];
[set setValue:@"abcd" forKey:@"2"];
[set setObject:@"higj" forKey:@"3"];
//删除一个
//[set removeObjectForKey:@"2"];
//删除多个
//NSArray * arr = [[NSArray alloc]initWithObjects:@"1",@"2", nil];
//[set removeObjectsForKeys:arr];
//删除所有
[set removeAllObjects];
NSLog(@"%@",set);
return 0;
}
int main(int argc, const char * argv[])
{
//可变字典
NSMutableDictionary * set = [[NSMutableDictionary alloc]init];
[set setValue:@"shdf"forKeyPath:@"1"];
[set setValue:@"abcd" forKey:@"2"];
[set setObject:@"higj" forKey:@"3"];
//删除一个
//[set removeObjectForKey:@"2"];
//删除多个
//NSArray * arr = [[NSArray alloc]initWithObjects:@"1",@"2", nil];
//[set removeObjectsForKeys:arr];
//删除所有
[set removeAllObjects];
NSLog(@"%@",set);
return 0;
}
相关文章推荐
- IOS-音乐播放器
- iOS prototype Cells
- iOS-项目的目录结构能看出你的开发经验
- iOS 宏(define)与常量(const)的正确使用
- iOS 调出storyboard里面起始Controller的箭头
- iOS几种传值方法的总结
- ios图文混排简单演示
- iOS项目开发实战——学会使用TableView列表控件(一)
- ios沙盒的使用
- 教你搞定IOS远程消息推送APNS
- iOS NSURLSession 下载
- ios 抓包工具 ios青花瓷charles
- iOS storyboard push到下一个界面后怎么再从下一个界面返回上一个界面
- iOS 自定义动画 push/pop动画
- iOS ImagePickerController 入门
- ios键盘不遮挡输入框
- ios的内购
- iOS 之CoreLocation反地理编码小Demo输入经纬度得到城市
- iOS 之CoreLocation基本使用
- IOS开发中设置控件内容对齐方式时容易混淆的几个属性