开发者

Initialization of NSMutableArray in a loop

I have an IBAction like this:

if([checkinArray count]!=0){
        [checkinArray removeAllObjects];
 }
loop{
    Checkin *checkinsA = [[Checkin alloc] init];
    .....
   [checkinArray addObject:checkinsA];
    [checkinsA release];

}

And when checkinArray is not empty I am getting exc bad access error and the app is crashing. What I am doing wrong here? What I am trying to do is to empty the array and then refill ti with updated data. PS. The checkin array is de开发者_运维技巧clared in .h and is initialized on viewdidload.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜