當前位置:成語大全網 - 新華字典 - object c nsdictionary 導入什麽命名空間

object c nsdictionary 導入什麽命名空間

介紹的api

//

//? main.m

//? NSDiconary

//

//? Created by ganchaobo on 13-4-29.

//? Copyright (c) 2013年 ganchaobo. All rights reserved.

//

#import <Foundation/Foundation.h>

void?CreateDic(){

//第壹種創建字典,創建多個key-value

NSDictionary?*dic=[NSDictionary?dictionaryWithObjectsAndKeys:@"k1",@"v1"

,@"k2",@"v2",@"k3",@"v3", nil];

//NSLog(@"%@",dic);

//第二種創建字典 創建壹對 key-value

NSDictionary?*dic1=[NSDictionary?dictionaryWithObject:@"VV"?forKey:@"KK"];

//? NSLog(@"%@",dic1);