![]() | Self-contained PRPAlertView |
|
11 Mar 2012, 09:21
Bernd Rabe (22 posts) |
Hi Matt, Paul, great work thx. Inspired me in many ways. Especially the self-contained PRPAlertview. Tried to do the same with one of my classes and failed – somehow :( I followed you pattern as follows
+ (void)createAutoreleaseObjectWithArguments:(UIViewController *)callingViewController
initBlock:(SelfContainedClass_InitBlock)initBlk
completionBlock:(SelfContainedClass_CompletionBlock)completionBlk
cleanupBlock:(SelfContainedClass_cleanupBlock)cleanupBlk {
[[[[self alloc] initAutoreleaseObjectWithArguments:object initBlock:initBlk completionBlock:completionBlk cleanUpBlock:cleanUpBlk] autorelease] present];
The base class is UIViewController which initialized via
if ((self = [super initWithNibName:NSStringFromClass([self class]) bundle:nil])) {
init class specific variables
}
return self;
within the initAutoreleasedObjectWithArguments method. The callingViewController is retained, the blocks copied. When I call [SelfContainedViewControllerClass createAutoreleasedObjectWithArguments ...]; the class is created the user interface presented but the class is immediatly released. If I ommit the autorelease call it is never released. The only difference to PRPAlertView is the delegate which I haven’t. Can you see an obvious problem with this construction? Thanks SOLVED |
| You must be logged in to comment |

