Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: XML Parser Help
View Single Post
Old 06-26-2009, 07:05 AM   #1 (permalink)
peterbrowse
Registered Member
 
Join Date: May 2009
Posts: 37
Default XML Parser Help

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
peterbrowse is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,677
Threads: 89,156
Posts: 380,394
Top Poster: BrianSlick (7,110)
Welcome to our newest member, Buster2000
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:23 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.