我有一段代碼,似乎沒有工作,因爲預期的表達式錯誤。預期的表達式錯誤目標c
NSMutableArray *worldData =[[NSMutableArray alloc] initWithArray:@[
@[ @1, @2, @3, @4,@5,@6],
@[ @1, @2, @3, @4,@5,@6],
@[ @1, @2, @3, @4,@5,@6],
@[ @1, @2, @3, @4,@5,@6],
]];
int *x = 1;
if (int 1 == (worldData objectAtIndex:1)){
UIImage *block31 = [UIImage imageNamed:
@"grass2.png"];
}
}
'(worldData [1] == @ 1)'這是不行的....:P –
你說得對,我我以前不知道直接的比較數字文字有未定義的行爲。 –