Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Beginning iOS 5 Application Development
|
BOOK: Beginning iOS 5 Application Development
This is the forum to discuss the Wrox book Beginning iOS 5 Application Development by Wei-Meng Lee; ISBN: 978-1-1181-4425-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iOS 5 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 14th, 2012, 05:59 AM
Registered User
 
Join Date: Feb 2012
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default Chapter3: Adding views dynamically using code

While working on the exercises at the end of chapter 3 I noticed that when implementing the loadView method, views added with the Interface Builder are not shown.

(I worked through the exercises all in the same project.)

Can you not combine views created in design time with views created at runtime?
 
Old February 14th, 2012, 02:37 PM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

If you haven't done so, it would be worth your while to read the documentation on the -loadView method. You only override -loadView when not using a nib. If no nib is specified, loadView will create a default empty view. If you wish to add objects to a nib outside of Interface Builder, you override the -viewDidLoad method. Customization and alteration of the view, once it is loaded, can be done as needed in response to events as long as you have a reference to it.

Bob
The Following User Says Thank You to thepianoguy For This Useful Post:
Brabbeldas (February 15th, 2012)
 
Old February 15th, 2012, 03:38 AM
Registered User
 
Join Date: Feb 2012
Posts: 6
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Thanks Bob! I got it working!
I would have expected your sentence "You only override -loadView when not using a nib" somewhere in the book!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding views NOT programmatically reneo BOOK: Beginning iPad Application Development 1 August 23rd, 2010 09:18 PM
Events - Adding Dynamically dash dev C# 2005 2 December 5th, 2007 02:05 PM
Adding Controls Dynamically andyj00 C# 0 March 19th, 2007 08:54 AM
dynamically adding objects shawnvb VB How-To 3 February 14th, 2007 03:12 PM
converting Access 2000 views to Sql views matta Classic ASP Professional 1 January 26th, 2005 03:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.