1
다음 코드에서 removeObject는 정상적으로 작동하지만 addObject는 작동하지 않습니다. 뭐가 잘못 되었 니?removeObject는 작동하지만 addObject는 동일하지 않습니다.
NSMutableArray *sourceList = self.questions;
NSMutableArray *randomizedList;
for (NSInteger i = sourceList.count; i > 0; i--) {
//other things
[randomizedList addObject:sourceList[index]];
[sourceList removeObject:sourceList[index]];
}
randomizedList 전에 동일하며 [randomizedList addObject:sourceList[index]];
후 실행 : 여기 NSArray > NAObject >isa Class 0x0
어떤 오류가 발생합니까? –
은'randomizedList' 가변 배열입니까? –
'randomizedList'의 전후에 표시하십시오. – Avi