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 -

ASP.NET Javascript: window.open won't work twice -

jquery - Opera does not change the height of the page. Why? -