Question

I have an application running SDK 3.2, I am using NSXMLParserDelegate for parsing XML.

I upgraded it to SDK 4.2 and my application keeps crashing when using the NSXMLParserDelegate, a warning said:

'Class' does not implement the 'NSXMLParserDelegate' protocol

I have tried the following:

  • Add the protocol to my class NSObject <NSXMLParserDelegate>
  • #import <Foundation/NSXMLParser.h>

But all my attempt had failed, please any help is so much appreciated.

Was it helpful?

Solution

Import the Foundation/NSXMLParser.h in header file and just put this line before your interface declaration:

@protocol NSXMLParserDelegate;
// ... and this code you already have but just to be sure it is written as:
@interface SomeYourClass <NSXMLParserDelegate> {

This is a forward declaration of protocol that is actually missing in newer version of NSXML parser.

OTHER TIPS

You can ignore that warning and you even should otherwise it wont run on older OSes.

About the crashing: Since the update to 4.2 i have the same problem when xmlparsing. The problem is that after the update the memory is getting filled and filled until the app crashes. The app had been working for months with no problem even with a hughe amount of data, those days are over. Unfortunately I dont know how to solve it properly. Have tried to find something in here but people keep insisting thats a bug in my code and that there is no change in the memory management...me i dont think so. Maybe there is really no change in memory management but then its another bug of iOS 4.2. I have limited my records now to 50 and it works a bit better...but thats not really a solution.

Hints are mostly welcome :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top