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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to