I have this strange problem. am using NSXMLParser to parse my XML data that is fetched from the network. Even though the "parse" call returns success, the delegate functions are not being invoked when the iPhone app runs for the first time. But, the exact same XML is parsed just fine with the delegate callbacks called properly when I restart the process (iPhone4 running iOS4.2) by killing the background task & restarting the app. Exact same behavior in both simulator and phone.
NSXMLParser *lxmlParser = [[NSXMLParser alloc] initWithData:jData];
MyXMLParser *pxmlParser = [MyXMLParser initXMLParser];
[lxmlParser setDelegate:pxmlParser];
BOOL success = [lxmlParser parse];
Instead of killing the background task, if I just push the app to the background and bring it back to foreground, the problem stays. The only workaround is to KILL the running background task (yes, mine is a background task listening to "significant location change") and restarting the app. From now on, the parsing just works fine...
Can someone pls help ?