Open main menu

lensowiki β

Changes

IPhone development tips

615 bytes added, 21:06, 7 January 2010
viewWillAppear + Xcode tips
*Watching out for deallocation and unloading of views
:Keep in mind that if a bunch of view controllers nested one above the other, there's a bunch of unloading and deallocating happening when these views disappear (hopefully, as you should be keeping your memory usage to a minimum). In one of my view controllers, I was overfreeing controller properties because I attempted to free them inside both <tt>viewDidUnload:</tt> and <tt>dealloc</tt> methods. Just remember that a view should only be getting dealloc'ed after it's been unloaded, so you only need to free most things in <tt>viewDidUnload:</tt>.
*Passing viewWillLoad/viewDidLoad/viewWillAppear/viewDidAppear/etc methods to child view controllers
:Say you have a view controller which manages a child view controller. The child view controller's viewWillAppear and related notification methods will *not* be called automatically by the OS for you. Your parent view controller needs to call those methods manually.
*Xcode is unable to connect to your device for some reason
:Sometimes Xcode will show your phone as being connected but will be unable to initialize it for development purpose for some bizarre reason. Simply restart your phone to fix the problem.
1,273
edits