当我尝试合并 2 时遇到问题NSString
NSSring
我从 JSON 中提取 2 ,它的图表是:
thumbList: ( "picture1.jpg", "picture2.jpg", "picture3.jpg" ... )
fullnameList: ("name1", "name2" , "name3" ... )
我的意图是使用以下方案将它们合并为一个:(“name1”,“picture1.jpg”,“name2”,“picture2.jpg”,“name3”,“picture3.jpg”......)
NSArray *array_webdata=[[NSArray array] init];
NSString *searchStatus = [[NSString alloc] initWithData:webData encoding:NSUTF8StringEncoding];
array_webdata = [parsedata objectWithString:searchStatus error:nil];
//String with all data of each user
NSString *usersList = [array_webdata valueForKey:@"results"];
NSLog(@"\n results? = %@ \n", usersList);
//String with thumbs
NSString *thumbList = [usersList valueForKey:@"thumb"];
NSLog(@"\n thumbs? = %@ \n", thumbList);
//String with usernames
NSString *fullnameList = [usersList valueForKey:@"fullname"];
NSLog(@"\n fullnames? = %@ \n", fullnameList);
NSMutableIndexSet *indexes = [NSMutableIndexSet indexSetWithIndex:1];
[indexes addIndex:3];
[fullnameList insertObjects:thumbList atIndexes:indexes];
NSLog(@"array: %@", fullnameList);
但是当我尝试执行时显示下一条错误消息:[__NSArrayI insertObjects:atIndexes:]: unrecognized selector sent to instance.
谁能帮我?