Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-05-2009, 04:26 PM   #5 (permalink)
mk12
Registered Member
 
Join Date: Jul 2009
Posts: 15
Default

don't use initWithNibName if the view controller is entirely coded programmatically, even if it works, that's very confusing. Get rid of your overriden initWithNibName method, and when you initialized call "init". If you want custom initialization, override init in your view controller. Note: in a view controller, override "init": for initialization that has to do with the view controller, not the view. For example, setting a BOOL ivar to YES. If you don't need to do anything in here, don't override it. "loadview": If you don't override this, all it will do is set self.view to a plain empty instance of UIView. Only override if you want to do something else, such as make self.view an instance of a custom UIView subclass, or set its backgroundcolor to red. If you override "loadview", you MUST set the self.view ivar. "viewDidLoad": Here you create everything that goes in the view, for example create a button and a label, and addSubview them to self.view.
mk12 is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,736
Threads: 89,191
Posts: 380,535
Top Poster: BrianSlick (7,129)
Welcome to our newest member, wrapsol
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:37 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.