On May 20, 2011, at 9:10 AM, Dave Zarzycki wrote:
> One could naively and wrongly "fix" this by decoupling the init method:
>
> controller = [[MyImportController alloc] init];
>// "controller" is now non-nil and safe to capture
> [controller setCleanupBlock: ^{ [controller rel
On 20 May 2011, at 15:10, Dave Zarzycki wrote:
> On May 20, 2011, at 5:48 AM, Ben wrote:
>
>> MyImportController *controller = nil;
>> CleanupBlock cleanup = ^{
>> [controller release];
>> // Other stuff
>> };
>> controller = [[MyImportController alloc] initWithCleanupBlock:[[cleanup
On Fri, May 20, 2011 at 5:48 AM, Ben wrote:
> controller = [[MyImportController alloc] initWithCleanupBlock:[[cleanup copy]
> autorelease]];
Nitpick: the caller of -initWithCleanupBlock: should not be
responsible for the memory management of the block. Rather,
-initWithCleanupBlock: should copy
On May 20, 2011, at 5:48 AM, Ben wrote:
> MyImportController *controller = nil;
> CleanupBlock cleanup = ^{
> [controller release];
> // Other stuff
> };
> controller = [[MyImportController alloc] initWithCleanupBlock:[[cleanup copy]
> autorelease]];
> [controller start];
> // The con