objective c - iOS Cocoa NSArrayI length]: unrecognized selector sent to instance -


i trying determine causing error:

2014-06-08 20:40:44.076 database[8656:70b] -[__nsarrayi length]: unrecognized selector sent instance 0x8a44050

here code.

nsdictionary* json = [nsjsonserialization jsonobjectwithdata:responsedata options:0 error:&error]; 

this breaking point error occurs: nslog([json allkeys]);

sample of json being used input:

{"1":{"key":"1","contentone":"aaa","contenttwo":"testing"},"2":{"key":"2","contentone":"bbb","contenttwo":null},"3":{"key":"3","contentone":"ccc","contenttwo":"testing"}} 

[json allkeys] returns nsarray, while nslog expects formatting string. try this:

nslog(@"%@", [json allkeys]); 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -