Objective-C怎么用一个key值把NSArray存到NSDictionary中??困了我好久啊,求大神解答
1,使用NSDictionary
NSArray * array = [[NSArray alloc] init];
[array addObject:@"first object string"];
NSString * key = @"kArrayKey";
NSDictionary * dict = [NSDictionary dictionaryWithObjectsAndValues:array, key, nil];
2,使用NSMutableDictionary
NSArray * array = [[NSArray alloc] init];
[array addObject:@"first object string"];
NSString * key = @"kArrayKey";
NSMutableDictionary * dict = [[NSMutableDictionary alloc] init];
[dict setObject:array forKey:key];