Reputation: 1398
I have an Application, that takes Restaurants from shared Google Api and displays it in a table view.Then i use
Carbon-kit
for pull to refresh content of tableview
refresh = [[CarbonSwipeRefresh alloc] initWithScrollView:self.tblRest];
//[refresh setMarginTop:120];
[refresh setColors:@[[UIColor blueColor], [UIColor redColor], [UIColor orangeColor], [UIColor greenColor]]];
[self.view addSubview:refresh];
[refresh addTarget:self action:@selector(pullToRefresh:) forControlEvents:UIControlEventValueChanged];
When i scroll my table and try to refresh it, It gives me below error:-
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 2 beyond bounds for empty array'
please help me for this error. Thanking you in advance.
Upvotes: 2
Views: 927
Reputation: 31647
This is happening because you must be initializing your array again while refreshing.
Upvotes: 3