nsdictionary - How can I use an integer value as 'key' to set value in NSMutableDictionaryw with Ios -
how can use integer value 'key' set float value in nsmutabledictionary ?
with nsnumber
literals can following
[dict setobject:@5.562 forkey:@5]; //or int key = 5; float value = 5.562; [dict setobject:@(value) forkey:@(key)];
and retrieve:
float retrval = [[dict objectforkey:@5] floatvalue];
Comments
Post a Comment