私はこれを持っています:
-(NSMutableArray*)setManch:(NSMutableArray*)data
{
NSMutableArray *manch=[data mutableCopy] ;
// some calculations on manch
return manch;
}
私がやろうとすると:
NSMutableArray *manch=[[data mutableCopy] autorelease] ;
クラッシュします。
しかし、私はrelease
この関数を何度も呼び出すので、どういうわけかこのコピーをしなければなりません。どうすればいいですか?
for(int k=0;k< count;k=k+2)
{
if(k==count-1)
[manch addObject:[NSNumber numberWithInt:![[manch objectAtIndex:k] integerValue] ] ];
else
[manch insertObject:[NSNumber numberWithInt:![[manch objectAtIndex:k] integerValue] ] atIndex:k+1 ];
}