Re: NSOperationQueue for NSXMLParser object
Re: NSOperationQueue for NSXMLParser object
- Subject: Re: NSOperationQueue for NSXMLParser object
- From: Karl Moskowski <email@hidden>
- Date: Fri, 6 Nov 2009 11:39:12 -0500
The problem may be that the NSOperationQueue releases your NSOperation
once the main method ends. If you don't retain it elsewhere, the
parser tries to fire delegate methods on a released object. Sounds
like you need to make your NSOperation concurrent (which, IMHO, is a
misnomer).
You move what's currently in main a to a start method, override
isConcurrent to return YES, and implement the parser's delegate
methods. When parsing is complete, change some flags and and send KVO
notifications. That way, the queue won't release the operation until
it's truly complete.
For useful info, see Dave Dribin's Blog on concurrent operations:
<http://www.dribin.org/dave/blog/archives/2009/05/05/concurrent_operations/
>
<http://www.dribin.org/dave/blog/archives/2009/09/13/snowy_concurrent_operations/
>
----
Karl Moskowski <email@hidden>
Voodoo Ergonomics Inc. <http://voodooergonomics.com/>
_______________________________________________
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