Re: Autorotation for a subview
Re: Autorotation for a subview
- Subject: Re: Autorotation for a subview
- From: mmalc Crawford <email@hidden>
- Date: Tue, 22 Dec 2009 17:21:41 -0800
On Dec 22, 2009, at 5:09 pm, Eric E. Dolecki wrote:
> I already stated (I believe) that I needed to redo the way this application is being constructed. In this way I'll have more direct access to subviews. I originally created another view controller with it's own nib and I was indeed loading it and using it as a subview to my main view. No leaks since it's removed itself from superview.
>
If you're using the code as shown, I can almost guarantee you will be leaking.
You don't show any code for releasing any previous instance of the view controller, so you'll be leaking that and so also its view.
Please review: <http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html>, and in particular "Using Accessor Methods" at <http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447>. And again, this is not how view controllers are intended to be used -- see <http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html>
> In regards to the NSNotification, I look at that as a learning opportunity and not merely a way of throwing some code at a problem hoping it will make it "work". I haven't ever used it before - I've only been part-timing iPhone apps for about 7 months now. It's fascinating and exciting and humbling when you're trying to do something and were unaware of the proper framework or methods to use.
>
A desire to learn is certainly an admirable trait. Given that the actual problem is still ill-specified, however, focussing on solving that issue would seem a more profitable strategy for now...
mmalc
_______________________________________________
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