Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOperationQueue for NSXMLParser object



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.