我只想從我的NSDictionary中獲得一個字段。我想獲得整型變量,但有些東西很奇怪。無法從NSDictionary得到int
我想告訴你一個Xcode的截圖,那裏我得到變量的值。變量'價格'是整數,應該等於0,你能幫助我嗎?
我以這樣的方式創建這個字典:
NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys:
[NSString stringWithFormat:@"%@",[dictionary objectForKey:@"price"]], @"price",
pairedData2, @"uniqueName",
[NSString stringWithFormat:@"0"],@"wasPurchased",
[dictionary objectForKey:@"link"],@"videoLink",
[NSString stringWithFormat:@"%@", [dictionary objectForKey:@"enable"]], @"enable",
nil];
很清楚(和耐心)答案。已投票。 –