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

Featured Member Applications

TanZen ($0.99)

Endless Walls ($0.99)

Air Hockey ($0.99)

SUPER STRIKE - Motion Bowl ($0.99)

BarSlot ($0.99)

MeterRead ($0.99)

Colorblind Helper ($4.99)

gContacts ($1.99)

ProgCalc ($1.99)

Forex On The Go Lite (FREE)

HUE knewit! ($0.99)

Want your application to be advertised here?

» Advertisements


Visit our friends over at The App Show! Steve and Dave produce a weekly show shining a light on the iPhone 2.0 software and the applications being developed by the amazing development community for the iPhone SDK!
» Stats
Members: 3,913
Threads: 5,613
Posts: 23,251
Top Poster: scottiphone (705)
Welcome to our newest member, dtochetto
Reply
 
LinkBack Thread Tools Display Modes
Old 10-07-2008, 11:54 PM   #1 (permalink)
Senior Member
 
Join Date: Sep 2008
Posts: 210
Default Need Some Help With Views

Ok so my Game is progressing nicely. I just have a few more things to flesh out. The most important of which is my game screens.

I used the "Bubble Level" App as a base for my game because it had a bunch of stuff I needed built in (sounds etc..)

Well right now the App loads directly into my main view.
What I would like to do is have the App load directly into a Start Screen when there are buttons for (Start,Resume,Setup etc...) And then load into my main view when the user starts.

Well I have my class setup for the Start Screen but I don't know how to point the XIB? or NIB? to load the start screen instead of the main view.

(None of my app was made in IB but apple has a XIB in the Bubble Level App)

As always any help is appreciated! you guys rock!
Kenrik is offline   Reply With Quote
Old 10-08-2008, 11:08 AM   #2 (permalink)
Senior Member
 
Join Date: Sep 2008
Posts: 210
Default

bumpity bum bump.
Kenrik is offline   Reply With Quote
Old 10-08-2008, 11:25 AM   #3 (permalink)
Junior Member
 
Join Date: Sep 2008
Posts: 9
Default

This is what I did for my first app game.

Create a SuperView UIView and have your app delegate load that first.

From that SuperView have it initially load your splash screen (UIView sub class).

Now when the user clicks on the screen, call the
Code:
[self removeFromSuperview]
in that splash screen view. That will in turn call the SuperView's
Code:
willRemoveSubview()
.

Implement this function in your SuperView:
Code:
- (void)willRemoveSubview:(UIView *)subview;
Its called everytime the subview is removed.

Once in that function,

Code:
if ( [subview isMemberOfClass: [SplashScreen class]] == TRUE) {
Determine which class is being removed. By knowing that it is the SplashScreen, you can create the main menu UIView there and add it to the SuperView.


So basically, if you have a SuperView which will handle the transitions between different parts of the game, ie, splash, main menu, score board, game board, etc..

This probably isn't the "correct" Apple way to do it, but it works well, and it sounds like it will help you
molnarr is offline   Reply With Quote
Old 10-08-2008, 03:35 PM   #4 (permalink)
Senior Member
 
Join Date: Sep 2008
Posts: 210
Default

Well what I ended up doing was this...

I took my StartScreen class and assigned it to load in my LevelViewControler.h and .m

Code:
- (void)viewDidLoad {
	CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame];

	// add the top-most parent view
	UIView *contentView = [[UIView alloc] initWithFrame:applicationFrame];
	contentView.backgroundColor = [UIColor blackColor];
	self.view = contentView;
	[contentView release];
	
	startScreen = [[StartScreen alloc] initWithFrame:applicationFrame viewController:self];
	[self.view addSubview:startScreen];

	levelView = [[LevelView alloc] initWithFrame:applicationFrame viewController:self];
    
    calibrationView = [[CalibrationView alloc] initWithFrame:applicationFrame viewController:self];
}
Then once I am in my startScreen I just have a button that switches over to the levelView

it Works!

You know Objective C was a really easy language to pick up. At first I was really, really confused but now everything just seems to make sense.

Thanks for your help.
Kenrik is offline   Reply With Quote
Reply

Bookmarks

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
Forum Jump

Powered by vBadvanced CMPS v3.0.1

All times are GMT -5. The time now is 03:56 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0