Fahim Parkar
Fahim Parkar

Reputation: 31647

iPhone restart in iPhone 6 & above only

I have an app where I have slider where I have used icarousel. Below slider I have list of events. When I click on event, it go to event details.

What I noticed is that my iPhone is restarting if I go to event details from list and click back button from the details screen.

This is happening with iPhone 6 & above devices only.

Click to see the stacktrace

As its big, I provide link.

Just to add, I have also used UIRefreshControl on UITableView. Below is the code I have used.

refreshControl = [[UIRefreshControl alloc]init];
[mainTableView addSubview:refreshControl];
[refreshControl addTarget:self action:@selector(refreshTable) forControlEvents:UIControlEventValueChanged];

-(void) refreshTable {
    [indicator startAnimating];
    indexCounter.text = @"0";
    indexCounter.hidden = YES;

    occasionsArray = [[NSMutableArray alloc] init];
    actualOccasionsArray = [[NSMutableArray alloc] init];
    mainOccasionsArray = [[NSMutableArray alloc] init];
    [refreshControl endRefreshing];
    [mainTableView reloadData];

    [self fetchHomeScreenOccassions]; // this is where I call webservice
}

Upvotes: 0

Views: 62

Answers (1)

dgatwood
dgatwood

Reputation: 10417

Congratulations. You have:

  • Found a crasher bug in the NSURLSession helper daemon
  • Managed to create an animation on a view or other item that is so huge that you crashed the window server.

I can't tell you exactly how your code managed to do either of those things, but... one thing I notice is that you're nuking the entire table view and then reloading it. That's not necessarily the best way to approach this problem. Instead, you should load the data, and (assuming it comes in a consistent order) iterate through the items in your existing array as you receive items, deleting anything that should have been received already and adding any new items that aren't in the array yet.

Upvotes: 2

Related Questions