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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-09-2011, 01:12 PM   #1 (permalink)
Z8I
Registered Member
 
Join Date: Oct 2011
Posts: 2
Z8I is on a distinguished road
Default Multiple views at once in the MainWindow or a ViewController

Hi,

What I want to do is this...


I have an app that is going to be divided into 2 parts. The top half of the screen ("game view")will be for displaying the app / game and the bottom half of the screen will be used for controls. Due to the nature of this app, the controls will be changing quite frequently and the "game view" won't.

To reduce some of the complexity, I've separated the controls and the "game view" into separate classes with separate .xib files.

So far what I've done is put 2 UIViews in the MainWindow.xib and filled each one with it's appropriate nib (i.e. the "game view" gets gameView.xib and the controls get controls.xib).

MainWindow.xib
=====================

UIView 1 loading nib 1 using Class 1

---- (middle of iPhone screen) ------


UIView 2 loading nib 2 using Class 2

==================

That works but I can't interact with the imported views at all. If I put a button on the controls view, it doesn't press, etc...

I've also tried loading MainWindow.xib with a view controller and then putting then importing the nibs into UIViews and that doesn't work.







Is there any way to do what I'm attempting to do? I know that I can display 2 views at once if I use the same class / xib but I'd like to keep them separate.







Thanks,


Stephen
Z8I is offline   Reply With Quote
Old 10-09-2011, 02:04 PM   #2 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

You need the controllers. You are only loading the view.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Old 10-09-2011, 03:06 PM   #3 (permalink)
Z8I
Registered Member
 
Join Date: Oct 2011
Posts: 2
Z8I is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
You need the controllers. You are only loading the view.
So I load the View controllers in the place of the UIViews? I under the impression I couldn't do this:

MainWindow.xib
==========


ViewController 1


--------


ViewController 2


==========


If it's possible, how might I do that?
(I do understand how to load and switch between controllers)
Z8I is offline   Reply With Quote
Old 10-09-2011, 03:49 PM   #4 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Have one main controller load into main window. Have the the main controller alloc both controllers and add their views as subviews. Have the main controller keep the 2 controllers around until it itself gets deallocated.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Reply

Bookmarks

Tags
view controllers

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 399
18 members and 381 guests
13dario13, 7twenty7, eski, EvilElf, glenn_sayers, HemiMG, jarv, LunarMoon, morterbaher, n00b, pbart, Pudding, QuantumDoja, sacha1996, Sami Gh, UMAD, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:22 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0