你好我有這個陣列是比較兩個陣列,看它是否與的NSLog數組排序錯誤原因不明
NSLog (@"1");
favoritesArray = [[NSMutableArray alloc] init];
NSLog (@"2");
//Add items
// favoritesArray = [[NSMutableArray alloc]init];
didContain = [[NSMutableArray alloc]init];
NSLog (@"3");
if ([favoritesArray containsObject:@"one"])
{
[didContain addObject:@"one"];
NSLog (@"4");
}
的第四日誌沒有按出現測試之後包含一個對象然而。 這是否意味着我的實現是錯誤的,如果它包含一個對象或者它意味着沒有像這樣的文件?
編輯 這裏是我添加一個數組
-(IBAction) addToFavorites {
favoritesArray = [[NSMutableArray alloc] init];
[favoritesArray addObject:@"one"];
NSLog (@"hello");
怎麼來的,這並不顯示爲對象@"one"
沒有什麼在這段代碼有什麼關係的文件。 – 2010-08-19 09:09:05
我編輯的問題 – 2010-08-19 09:18:29