0
votes

I am parsing using SOAP, in the didFinishLaunchingWithOptions method, only for the first time app gets launch. The issue is, my view gets called before the xml is parsed using

-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName

My didFinishLaunchingWithOptions is like

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSString *soapMessage = [NSString stringWithFormat:...................

//everything here with SOAP

self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES; }

I wan to call this self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES;

once my

-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName gets finished and i get the result string.

Currently, i got the result string after sometime, in the next view. I just want to call the next view, once i got the result string.

How can i get that?

Best Regards

1
It seems you want to turn an async operation into a synchronic one.onnoweb
I think this is not a good option as watchdog timer may time out.Parth Bhatt
Than how can i perform this action,what is the most suitable way?Shishir.bobby

1 Answers

2
votes

I think you're choosing the wrong approach. Apple requires apps to startup within 5 seconds give or take. If your parsing would have issues (because of bad network connection e.g.) then your app will just close before it's finished parsing and your view controller will never be displayed.

You should put the XMLParsing code in a seperate class and perform a callback on the AppDelegate once parsing is finished. Then set the results of the parsing as a property of your view controller and update interface if required (e.g. by calling '-reloadData' on a tableView).