Hello!
I am attempting to follow the tutorial shown here - http://www.iphonesdkarticles.com/2009/01/uitableview-sectioned-table-view.html - and implement it in my own code.
Here's the problem I'm getting -
data, wishlists, and wishlistids are all NSMutableArrays. I know this problem is occuring on the line where I try to add the dictionary to the data array. Look at the code:
- (void)setupWishlists:(NSString *)informationReturned
{
if(![informationReturned isEqualToString:@""]){
//[data setArray:[informationReturned componentsSeparatedByString:@"."]]; //this works too, its an old method I kept just incase... this one has the raw combined wishlists name and id together. Here I attempt to split them.
NSMutableArray *temporaryArray = [NSMutableArray array];
NSArray *rawArray = [informationReturned componentsSeparatedByString:@"."];
for (NSString *item in rawArray) {
//so pretty much here we have the raw information that came back... remove the IDs
[temporaryArray setArray:[item componentsSeparatedByString:@","]];
[wishlists addObject:[temporaryArray objectAtIndex:0]];
[wishlistids addObject:[temporaryArray objectAtIndex:1]];
}
//Initialize the array.
NSDictionary *myWishlistsDict = [NSDictionary dictionaryWithObject:[NSArray arrayWithArray:wishlists] forKey:@"My Wishlists"];
[data addObject:myWishlistsDict]; //GETTING PROBLEM HERE!!! IF I COMMENT THIS LINE IT IS FINE
}
NSLog(@"Raw Wishlists Array: %@", [data description]);
}
Also I am sure to alloc all of those arrays etc in a function I am sure to run before this one.
data = [[NSMutableArray alloc] init];
wishlists = [[NSMutableArray alloc] init];
wishlistids = [[NSMutableArray alloc] init];
This is the error(seen in console:
2010-08-26 19:53:47.598 LoginApp[7604:207] -[__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x59b5760
2010-08-26 19:53:47.600 LoginApp[7604:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x59b5760'
Anyway I feel like I left something out... If I did please tell me and I will be sure to answer quickly.
Thanks, Christian Stewart