Hey everyone,
Wonder if a little guidance could be offered, I had my first app bundle all ready and zipped to go when I was playing around with my so called finished product on my device when I found a rather major bug which causes my app to crash before its even finished loading.
I thought I got this glitch in my code with:
Code:
- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError {
NSString * errorString = [NSString stringWithFormat:@"Unable to download story feed from web site (Error code %i )", [parseError code]];
NSLog(@"error parsing XML: %@", errorString);
UIAlertView * errorAlert = [[UIAlertView alloc] initWithTitle:@"Error loading content, please check data connection" message:errorString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[errorAlert show];
[errorAlert release];
}
However currently all I get is that the app hangs on the default slapsh screen and the screen does the dimming halo effect as if an alert window is going to be displayed but then in console the app terminates with the following error:
-[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)'
now I understand that basically it is carrying on through the code not pausing for the user to select "OK" after which I could set the action to terminate the program, it is then reaching the first point in the code where an array is sourced from which obvioulsy doesn't exsist or hasn't been populated yet..
I read that there is no real system pauses as its been written out.. has anyone got any suggestions of what avenue to go down to halt the progress of the app and kill it on the user input of OK as there is no network coverage etc.. rather than terminating itself from an uncaught exception.
I hope I made sense..
Any help appreciated,
Peter