• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSXMLParser bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXMLParser bug?


  • Subject: Re: NSXMLParser bug?
  • From: Graham Cox <email@hidden>
  • Date: Thu, 11 Sep 2008 22:18:42 +1000


On 11 Sep 2008, at 9:57 pm, Karan, Cem (Civ, ARL/CISD) wrote:

Hi all, I wanted confirmation of this by someone else before I filed a useless bug report. I'm using NSXMLParser in a slightly non- standard way, just so I can slog through my unit tests quickly. I instantiate it like this:

NSXMLParser *dummyParser = [[NSXMLParser alloc] init];

Rather than use either initWithContentsOfURL: or initWithData:. My unit test runs fine right up until I go to release the parser; then they crash in NSXMLParser's dealloc method. Does anyone else see this as well? My test case code is now down to this:

- (void) testParserDelegateMethods
{
	NSXMLParser *dummyParser = [[NSXMLParser alloc] init];
	NSAssert(dummyParser != nil, @"Problem allocating parser");
	NSLog(@"Parser retain count = %u", [dummyParser retainCount]);
	[dummyParser release];
}


from the docs:

initWithData:
[]

Discussion
This method is the designated initializer.



This means you *MUST* call this initializer when creating the object, directly or indirectly. I'm guessing that -init isn't overridden to call this. Maybe you could pass an empty data object?

hth, Graham
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • RE: NSXMLParser bug?
      • From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
References: 
 >NSXMLParser bug? (From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>)

  • Prev by Date: Cocoa Installer classes
  • Next by Date: Re: Cocoa application running very slow under 64 bit
  • Previous by thread: NSXMLParser bug?
  • Next by thread: RE: NSXMLParser bug?
  • Index(es):
    • Date
    • Thread