iPhone app crash [__NSCFString objectForKey:] unrecognized selector sent to instance

前端 未结 1 1359
Happy的楠姐
Happy的楠姐 2020-12-22 03:04

I am trying to add in tempArray only even number of data.localBookmarks is array of dictionary. Here is my code :

currentIndex = indexPath.row;
for (NSDicti         


        
相关标签:
1条回答
  • 2020-12-22 03:52

    Why you are crashing

    The variable dict that you think is a NSDictionary is actually a NSString. Since strings don't respond to the objectForKey: method your app crashed. That is what the error message is telling you.

    Where the problem lies

    Your statement: "data.localBookmarks is array of dictionary" is false. At least one of them is just a string.

    Check where your localBookmarks comes from. If it's data you are parsing you may need to change that.

    0 讨论(0)
提交回复
热议问题