0

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.

lostInTransit
71.1k62 gold badges202 silver badges276 bronze badges
asked Aug 11, 2011 at 11:02

2 Answers 2

1

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.

answered Aug 11, 2011 at 11:10
Sign up to request clarification or add additional context in comments.

1 Comment

I have put NSLog in all didReceiveMemoryWarning method but none of that gets print in console only suddenly CoreAnimation: ignoring exception: *** -[NSArray objectAtIndex:]: index 1 beyond bounds [0 .. 0] appears in console.
0

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:)

answered Aug 12, 2011 at 12:02

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.