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

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -