ios - Values in a sub JSON array to an NSString -


from web service, json response looks this.

{     data =     {         category = "barclays premier leaguejk";         "download_counter" = 1;         id = 2;         rating = 5;         tags =         (             "primera a",             "primeira liga"         );         title = "carles puyol";     };     status = 1; } 

using [data valueforkeypath:@"tags"], have taken out sub array.

(     "primera a",     "primeira liga" ) 

i need values inside nsstring. there simple way that?

nsarray *array =[data valueforkeypath:@"tags"];  nsstring *requiredstring = [nsstring stringwithformat:@"%@",[array componentsjoinedbystring:@" "]]; 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -