Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
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 declared in .h and is initialized on viewdidload.
If it is already empty, then what does it matter if you remove the objects again? It's not like the operation will take that long. But if your most common situation involves a populated array, then all you've done is add a test in front of the operation that you really want to perform anyway. Test time + operation time > operation time, every time.
If it is already empty, then what does it matter if you remove the objects again? It's not like the operation will take that long. But if your most common situation involves a populated array, then all you've done is add a test in front of the operation that you really want to perform anyway. Test time + operation time > operation time, every time.
I am trying to updated the content of the array with new data. Thats why I am testing if is empty. If is not then I am adding the data.
Replies
Recall It! for iPad
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeAnd I don't see much point for this test:
if([checkinArray count]!=0){[checkinArray removeAllObjects];
}
If it is already empty, then what does it matter if you remove the objects again? It's not like the operation will take that long. But if your most common situation involves a populated array, then all you've done is add a test in front of the operation that you really want to perform anyway. Test time + operation time > operation time, every time.
SlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeNSMutableArray *checkinArray;
....
@property (nonatomic, retain) NSMutableArray *checkinArray;
and initializing in viewdidload:
checkinArray = [[NSMutableArray alloc] init];
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeAnd you are declaring it in .h. You are creating it in viewDidLoad.
SlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomeI am using it in another method:
Checkin *tempcheck2 = [checkinArray objectAtIndex:i];
but this should be autoreleased right? Also this method is finished before calling the [checkinArray removeAllobjects];
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like AwesomePost the entire code for your IBAction. You have a typo in the first post anyway.
SlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome