ios - Iphone application crash when i post JSON data through PHP webservice having null values -


i developing webservice through php iphone application convert send json object iphone app whenever webservice called.

problem while converting deep multidimensional array may contain null values.i want covert all null values empty string application don't crash.is there way check deep inside multidimensional array sometime deep removing null values.and 1 more thing need solution in such way don't slow down whole process because mobile application , if there solution can tell mobile developer can handle side

example of array provided

array (     [result] => 1     [data] => array         (             [basic_detail] => array                 (                     [name] => coca-cola company                     [industry_detail] => array                         (                             [0] => array                                 (                                     [industry_name] => beverages                                 )                          )                      [category_detail] => array                         (                             [0] => array                                 (                                     [category_name] => soft drinks                                 )                              [1] => array                                 (                                     [category_name] => water                                 )                              [2] => array                                 (                                     [category_name] => juices                                 )                              [3] => array                                 (                                     [category_name] => energy & sport drinks                                 )                              [4] => array                                 (                                     [category_name] => hot beverages                                 )                          )                      [nationality] => array                         (                             [0] => american                         )                  )             [story_text] =>          )  ) 

if want add null value array, use

[array addobject:[nsnull null]]; 

it's value equal null , application won't crash if array contains [nsnull null] objects.


Comments

Popular posts from this blog

asp.net mvc 3 - Using mvc3, I need to add a username/password to the sql connection string at runtime -

kineticjs - draw multiple lines and delete individual line -

thumbnails - jQuery image rotate on hover -