objective c - NSDictionary - List all -


in nsmutabledictionary this:

[nsmutabledictionary dictionarywithobjectsandkeys: [nsstring stringwithstring:firstname], @"name", [nsnumber numberwithfloat:familyname], @"surname", nil]; 

how can of elements converted nsstring? requirement names , surnames arranged in string this: "name, surname, name, surname..."?

this gives string names not surnames:

nsstring * result = [[urlarray valueforkey:@"name"] componentsjoinedbystring:@", "]; 

is there way similar 1 above create string values of nsmutabledictionary?

try this:

nsstring *result = [nsstring stringwithformat:@"%@, %@", [urlarray valueforkey:@"surname"], [urlarray valueforkey:@"name"]]; 

the %@ represents objective-c object more details see apple docs


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -