0
這是我的代碼內EXC_BAD_ACCESS同時加入一個目的是一個陣列的開關
INT indiceCorrente = 0; int differenza = delegate.reader.feedItems.count;
while(variable!=0){
switch(variable){
case 1: ----
case 2: ----
default: {
NSMutableIndexSet *add=[[[NSMutableIndexSet alloc]init] autorelease];
[add addIndex:indiceCorrente];
[add addIndex:indiceCorrente+1];
[add addIndex:indiceCorrente+2];
[self aggiungiElementoArrayLettura:add];
//[page addObject:@"makeLayout3"];
NSMutableArray *pagina=[[NSMutableArray alloc]init];
indiceCorrente=indiceCorrente+1;
[pagina addObject:indiceCorrente]; <------ EXC_BAD_ACCESS WHY????
indiceCorrente=indiceCorrente+1;
[pagina addObject:indiceCorrente];
indiceCorrente=indiceCorrente+1;
[pagina addObject:indiceCorrente];
[pages addObject:pagina];
}
}
}
是什麼aggiungiElementoArrayLettura – logixologist
您需要的對象,而不是一個'int',這是一個基本類型。看到像這樣的問題:http://stackoverflow.com/questions/10486519/adding-integer-to-nsmutablearray –