combining 2 strings in objective-c-Collection of common programming errors
I have a problem when I try to combine 2 NSString
I extract 2 NSSring form a JSON and its diagrams are:
thumbList: ( “picture1.jpg”, “picture2.jpg”, “picture3.jpg” … )
fullnameList: (“name1”, “name2” , “name3” … )
My intention is unite them into one using the following scheme: (“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);
But when I try to execute shows the next error message: [__NSArrayI insertObjects:atIndexes:]: unrecognized selector sent to instance.
Can anyone help me?