Fwd: NSOperation and NSAutoreleasePool
Fwd: NSOperation and NSAutoreleasePool
- Subject: Fwd: NSOperation and NSAutoreleasePool
- From: Aaron Wallis <email@hidden>
- Date: Sat, 7 Mar 2009 16:20:49 +1100
Hey all,
I've got a series of NSOperations which process some data for the user.
Each of them are created and supplied a large string.
In the operations start method the operation finds a suitable plugin
(using a plugin manager) to help the data analsysis. Once the plugin
is found, the string and delegate (which is the NSOperation instance)
is supplied for processing.
The operation then waits for the plugin to call the "complete"
delegate function, upon which time the operation saves the data and
cleans up.
So that's how it should work...
The problem i've got is when I supply the plugin the delegate:
[tPlugin processDataInFile:tFilePath withDelegate:self];
the plugin see's the delegate parameter as an NSAutorelease object.
i.e. if I NSLog the delegate object:
- (void)processDataInFile:(NSString *)tFilePath withDelegate:
(id)tDelegate {
self.delegate = [tDelegate retain];
NSLog(@"Process data in %@ using delegate %@", tFilePath,
self.delegate);
I get the output:
Process data in 090227/123.txt using delegate <NSAutoreleasePool:
0x187e10>
when it should say something like:
Process data in 090227/123.txt using delegate
<TMPSTProcessDropOperation: 0x175930>
Any ideas what I could be doing wrong?
_______________________________________________
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