I am developing an iPhone application and everything seems to work fine. But when I use the app for some amount of time suddenly on view load
CoreAnimation: ignoring exception: *** -[NSArray objectAtIndex:]: index 1 beyond bounds [0 .. 0]
comes and after that the view life cycle methods are not called (basically the app stop responding).
Please suggest me if anyone knows the significance of this error or how do I resolve it.
2 Answers 2
Did you check if you get any memory issues just before this error message pops up? Implement the didReceiveMemoryWarning method in all your viewcontrollers (put in NSLog statements for now) and see if any of these are printed before you get this error.
1 Comment
Finally I got solution to my problem , it really very strange but would like to share with all of you so that if you guys face the same error, can check for this:-
On debugging my whole project I came to know on a when I click on a certain button and then click on any where else so that that page viewWillDisappear Method gets called.
-(void)viewDidDisappear:(BOOL)animated
{
NSString *finalTimeString=self.timeLabel.text;
if (![finalTimeString isEqualToString:@""] || finalTimeString!=nil) {
NSArray *aRR =[finalTimeString componentsSeparatedByString:@"-"];
NSString *startTimeString = [[aRR objectAtIndex:0] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSString *endTimeString = [[aRR objectAtIndex:1] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
[appDelegate.searchDataDictionary setObject:startTimeString forKey:@"time_str"];
[appDelegate.searchDataDictionary setObject:endTimeString forKey:@"time_end"];
}
}
I came to know that when I got finalTimeString empty then that error came and if finalTimeString contain some data then it works fine.So I put condition according to my self and got rid from this error. Happy Coding:)