ios - How to get rid of objects when Parsing JSON data -
ios - How to get rid of <null> objects when Parsing JSON data -
for now, have working web service calls returns titles of cheapest objects searched for. instance if searched "book", homecoming cheapest books in area. however, sometimes, objects, this:
2014-06-26 13:14:12.008 findthecheapestone[2244:60b] little book of champagne 2014-06-26 13:14:12.009 findthecheapestone[2244:60b] holy bible 2014-06-26 13:14:12.010 findthecheapestone[2244:60b] <null> 2014-06-26 13:14:12.010 findthecheapestone[2244:60b] books of hebrew bible (study guide): book of proverbs, book of job, book of esther, book of jeremiah, book of isaiah, song of songs 2014-06-26 13:14:12.010 findthecheapestone[2244:60b] book of job : short reading 2014-06-26 13:14:12.010 findthecheapestone[2244:60b] book of jeremiah when these objects, store them array, , pass array tableviewcontroller. however, can't pass these objects, , hence sigabrt consequence.
here how attempted prepare it:
(nsdictionary *theitem in itemcallarray) { nsstring *titlestring = theitem[@"title"]; if (titlestring !=null) { [titlearray addobject:titlestring]; nslog(@"%@", titlestring); } } resultstableviewcontroller *tablevc = (resultstableviewcontroller *)segue.destinationviewcontroller; [tablevc setarray:titlearray]; } i still sigabrt, , doesn't prepare problem.
all help appreciated, , in advance :)
a test checking null value can be:
if (title == (id)[nsnull null] || title.length == 0 ) hope help. happy coding :)
ios objective-c json xcode web-services
Comments
Post a Comment