Re: NSOperation and NSAutoreleasePool

2009-03-07 Thread Andy Lee
On Mar 7, 2009, at 6:48 PM, Kyle Sluder wrote: On Sat, Mar 7, 2009 at 5:52 PM, Aaron Wallis wrote: When I step through the process in debugger it just confuses me more. I've put a breakpoint on the "self.delegate = tDelegate" assignment and stepped through each part of the process (until the

Re: NSOperation and NSAutoreleasePool

2009-03-07 Thread Kyle Sluder
On Sat, Mar 7, 2009 at 5:52 PM, Aaron Wallis wrote: > When I step through the process in debugger it just confuses me more. > I've put a breakpoint on the "self.delegate = tDelegate" assignment and > stepped through each part of the process (until the error occurs). I really, *really* cannot emph

Re: NSOperation and NSAutoreleasePool

2009-03-07 Thread Aaron Wallis
Ok, Few quick answers, yes it's being synthesized and no, I haven't specified my own setters/getters, i'm just letting Cocoa do that part itself. When I step through the process in debugger it just confuses me more. I've put a breakpoint on the "self.delegate = tDelegate" assignment and s

Re: NSOperation and NSAutoreleasePool

2009-03-07 Thread Roland King
On Mar 7, 2009, at 2:18 PM, Aaron Wallis wrote: The property was assigned as: @property (retain) id delegate; when I walk through the code (and log pretty much everything out) I get the following: - (void)processString:(NSString *)tString withDelegate:(id)tDelegate { NSLog(@"1. %@", tDelegate

Re: NSOperation and NSAutoreleasePool

2009-03-06 Thread Kyle Sluder
On Sat, Mar 7, 2009 at 1:31 AM, Aaron Wallis wrote: > Thanks for pointing that one out, but it wasn't the cause for my problem. > As for retaining the delegate, originally I wasn't, I just took the advice > from Roland, but it doesn't break if I don't have it there :D Just because it doesn't brea

Re: NSOperation and NSAutoreleasePool

2009-03-06 Thread Aaron Wallis
Thanks for pointing that one out, but it wasn't the cause for my problem. As for retaining the delegate, originally I wasn't, I just took the advice from Roland, but it doesn't break if I don't have it there :D On 07/03/2009, at 5:27 PM, Graham Cox wrote: On 07/03/2009, at 5:18 PM, Aaron W

Re: NSOperation and NSAutoreleasePool

2009-03-06 Thread Stephen J. Butler
On Sat, Mar 7, 2009 at 12:18 AM, Aaron Wallis wrote: > The property was assigned as: > @property (retain) id delegate; > > when I walk through the code (and log pretty much everything out) > I get the following: > > - (void)processString:(NSString *)tString withDelegate:(id)tDelegate { > NSLog(@"1

Re: NSOperation and NSAutoreleasePool

2009-03-06 Thread Graham Cox
On 07/03/2009, at 5:18 PM, Aaron Wallis wrote: [delegate release]; delegate = tDelegate; [delegate retain]; What if tDelegate == delegate? You release delegate, which *may* dealloc it. Then you assign tDelegate to it. If tDelegate == delegate (not uncommon that objects are the same) the

Re: NSOperation and NSAutoreleasePool

2009-03-06 Thread Graham Cox
On 07/03/2009, at 5:02 PM, Roland King wrote: seems probably wrong if delegate is a retained property, that will just extra-retain it. Your new code delegate = tDelegate; doesn't retain it at all, one of the following should be the right way to do it Bearing in mind that typica

Re: NSOperation and NSAutoreleasePool

2009-03-06 Thread Aaron Wallis
The property was assigned as: @property (retain) id delegate; when I walk through the code (and log pretty much everything out) I get the following: - (void)processString:(NSString *)tString withDelegate:(id)tDelegate { NSLog(@"1. %@", tDelegate); // I get 0x175930> self.delegate = tDelegate;

Re: NSOperation and NSAutoreleasePool

2009-03-06 Thread Roland King
this isn't making sense. You need to get to the bottom of this and not just throw in random code which *seems* to work. For a start how is delegate declared as a property? Show us the definition please, and are you synthesizing it or have you written code for the methods yourself? If you ha

Re: NSOperation and NSAutoreleasePool

2009-03-06 Thread Aaron Wallis
I've actually found a workaround - it seems that if I use Obj-C 2.0 style properties the objects somehow get released earlier than they should. in my example I used the code: self.delegate = tDelegate where tDelegate is the delegate supplied through the method call. However, if I just use: de

Re: NSOperation and NSAutoreleasePool

2009-03-06 Thread Kyle Sluder
It sounds like you have some sort of memory issue. Since you refer to things like "NSAutorelease objects" (which don't exist) and are apparently calling -retain on an object that you immediately assign to a property, I suggest you go back and re-read the Memory Management Guide. --Kyle Sluder ___

Fwd: NSOperation and NSAutoreleasePool

2009-03-06 Thread Aaron Wallis
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