iphone开发 如何在NSMutableDictionary中放入基本数据类型
生活随笔
收集整理的這篇文章主要介紹了
iphone开发 如何在NSMutableDictionary中放入基本数据类型
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
NSMutableDictionary中只能放入對象,不能放入基本類型,這一點請參考java的Map系列。。。 然則NSInteger。。不是對象。。。。NSNumber才是,所以應該這樣放的:
NSInteger aInteger; NSMutableDictionary *dic=[[NSMutableDictionary alloc initWithCapacity:10]; [dic setObject:[NSNumber numberWithInteger:aInteger]forKey:@"TheKey"];?
轉載于:https://www.cnblogs.com/sybz/archive/2012/08/04/2774521.html
總結
以上是生活随笔為你收集整理的iphone开发 如何在NSMutableDictionary中放入基本数据类型的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 求 A^B mod C. (1=A,C=
- 下一篇: mdi 子窗体 菜单 不合并。