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

View Single Post
Old 03-11-2009, 12:52 PM   #7 (permalink)
JoeBlaze
Registered Member
 
Join Date: Jan 2009
Posts: 97
Default

The problem is that applicationDidFinishLaunching only occurs once so the passedString value will never be searched again if changed.

Try this in the app delegate

Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application{
	// Configure and show the window
	[window addSubview:[navigationController view]];
	[window makeKeyAndVisible];
}
//Implement your own boats getter 
- (NSArray*)boats{
//I recommend surrounding all of this code before the return with an if statement
//checking to see if passedString has changed to prevent duplicate web calls

NSString *xmlStart = @"http://www.mysite.com/search="; 	
	NSString *searchWord = passedString; 
	NSString *xmlEnd = @"&xml=1";
	
	NSString *newString;
	newString = [xmlStart stringByAppendingString:searchWord];	
	XML = [newString stringByAppendingString:xmlEnd];
	

	NSURL *url = [[NSURL alloc] initWithString:XML];
	NSXMLParser *boatListParser = [[NSXMLParser alloc]       initWithContentsOfURL:url];
	
	BoatListParser *parser = [[BoatListParser alloc] initBoatListParser];
	[boatListParser setDelegate:parser];
	
	BOOL success = [boatListParser parse];
	
	if(success)
		NSLog(@"Success");
	else
		NSLog(@"Error");

return (boats parsed from xml); //This is where you return the array of BOAT objects
}
JoeBlaze is offline   Reply With Quote
 

» Advertisements
» Online Users: 708
20 members and 688 guests
ADY, Anahtarcı, dacapo, dapis, denied, fanarin, Fit4him, jimbo, joeallenpro, LiquidFire, mathieuh, padsoftware, Punkjumper, ric2z, robotkid249, Sander, thesooty, Thompson22, troop231, tymex
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,558
Threads: 89,128
Posts: 380,257
Top Poster: BrianSlick (7,103)
Welcome to our newest member, thesooty
Powered by vBadvanced CMPS v3.1.0

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