Reputation: 11
I am importing data from a website using TouchJson. This data is supposed to be viewed in a UITableVIew. The app is a Tab Bar based app. When I run the app it crashed with the following error, throwing an exception in the following line:
Error: [__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance
Code: cell.textLabel.text = [recipeSection objectAtIndex:row];
My cellForRowAtIndexPath's source code is found here: http://pastebin.com/s3xr4NTc
The JSON I use is found here: http://muncken.myftp.org/eatstrong2/iphone/recipeList.php
My target is to show the recipes as an indexed UITableView, but I am doing it stepwise.
Upvotes: 1
Views: 2126
Reputation: 4286
You are trying to call a method (selector) isEqualToString on an NSDictionary object. This doesn't support the isEqualToString method - hence the error.
Upvotes: 2
Reputation: 9453
The error is saying that you are trying to use a method of an NSArray objectAtIndex
on a NSCFDictioanry object. It will happen if at this line:
NSArray *recipeSection = [recipes objectForKey:key];
your objectForKey
returns NSDictionary
instead of expected NSArray.
Upvotes: 0