I have a problem with the new PageViewController (the one with the nifty page turn animations). As far as I understand, there is a stack of ViewControllers which you need to
autorelease
is exactly what you need. This is the perfect situation for which autorelease
was designed i.e. you need to return an object but don't know how long it will be needed.
PageView *pView = [[PageView alloc] init] autorelease];
return pView;
Your PageView instance is allocated on the heap (not the stack) and PageViewController will take ownership of it and retain it if it needs to keep it around. It becomes PageViewController's responsibility after your method has returned.
(Otherwise just use ARC and let the compiler take care of it)