1
我得到這個警告,我不知道如何解決它。在那裏我得到警告線是初始化使整數沒有鑄造
NSInteger thescore = [[myDictionary objectForKey:@"Score"] objectAtIndex:0];
如果它的確與衆不同,myDictionary是的NSDictionary
編輯:這是怎麼回事?順便說一句我的數組是一個NSMutableArray的,而不是一個NSArray的
NSInteger thescore = [[myDictionary valueForKey:@"Score"] integerValue];
編輯2: @Bavarious提到,我應該做到以下幾點:
int thescore = [[myDictionary objectForKey:@"Score"] integerValue];
+1。也可以這樣做:[[[objectEdKey:@「score」] objectAtIndex:0] integerValue];'並將結果賦給一個'NSInteger'。 – 2011-06-05 06:08:46
+1 ..... Josh :) – Legolas 2011-06-05 06:09:38
這是怎麼回事?順便說一句,它是一個NSMutableArray迴應答覆者。 – 2011-06-05 06:14:09