Can you do this without a delegate.. I just have the viewController (.h and .m) with it's xib file. But I don't know if this will work because View Controllers don't have windows, just a view.
I am trying to make a soundboard, with a switch view, and I am able to make a switch view app, and a soundboard app, however I am having problems combining the two... can you help? please!!!?
In mine I have 6 views, but when I open (build and go) the simulator opens but the app thAt loads it just. White screen, how do I get it to show what I have done in the interface builder?
Hi appleHack, I am a subscriber and really liked this tutorial. I am new at this, so maybe this is a stupid question, but how do you write the .h and .m files for the new views? Just make a new class file? For example if I wanted to play a sound clip or video clip on view 2, how is that done? i looked for other tutorials on this, but i think you are the only one that has broken the views down like this...brilliant by the way! I have been at this for weeks, and finally a tutorial that I get!
I found this an superb tutorial on how to make multiple views quickly but I have come across a problem worthy of another tutorial which know one seems to cover. If you build a project that has say 10 views and you navigate to say view 6 and you want to go back to view 5 how would you do this?
I have tried for hours (newbie) to get this to work taking reference from the way view2 goes back to view one but I don't seem to be able to replicate it on other views.
In your IBAction for your switch to view 5 button, you would do this:
[view6 setHidden:YES];
[view5 setHidden:NO];
and if you wanted to make sure all the views were hidden except 5, just to make sure, you would just do [view/*(Number)*/ setHidden:YES]; for each view.
your an idiot this is not the easiest way to do it its alot more than 2 lines of code and it wont work with alot of people because alot of peolpe wont have the apdelegate because they arent doing this on their main view
@SoopleGamer Yes you do. It's your AppNameAppDelegate.h and .m. Or if you're talking about interface builder, then you need to open up your MainView.xib. This doesn't have to be done in the AppDelegate, it can be done in the ViewController.
@AppleHack23 Ok. I found AppDelegate and put it in the APPNAMEViewController.xib and everything hooked up right. It loaded fine and when I click on the button, it crashes and returns to the home menu. I'll deploy this to my phone and see if it's just the simulator. Also I changed UIWindow to UIView since I have to have View application since I need it in landscape.
@SoopleGamer Transfered the files to the viewcontroller.h and .m. I load it and it goes to a blank view. I added the -(void)viewDidLoad in viewcontroller.m and it still does that.
@Lancewise Open Interface Builder, click on your Window in your document, in the first tab of the Inspector, check of, "Visible at launch". If that doesn't work just comment again, and I'll have another answer.
@AppleHack23 well it worked at first but now its doing it again. Simulator wont open with the right window even after I checked the visible at launch box. It seems to open the last window made each time if that helps at all. Thank you again for you help and you tutorial was very to the point and easy to follow btw.
@Lancewise In your .m, find a new space, and type the following.
-(void)viewDidLoad { [windowName setHidden:YES]; */do that for every window except the one you want to see at launch. Replace windowName with the name of your window./*
It's easy but bad style.
Aras19862202 1 month ago
Easiest tutorial on this I have seen. Thanks!
JDKinkle 4 months ago
If this helps you need 2 buttons on each view one forward one back..
richardlipp21 6 months ago
im using xcode 4 and it crashes every time i try to press the switch button. help!
red87445 7 months ago
ive tried doing this inside a tap bar app and the app always crashes when i klick on he button!
torpedox1503 9 months ago
WOW!! That was great, it also works for view based apps too, this is great thanks for the tutorial!! BIG HELP
kinley35 9 months ago
can u use the "setHidden" on views instead of windows?
gleetooth 9 months ago
Thanx mate!!
hendrikvandijk1967 10 months ago
easier way>>>>>>>> youtube . com/user/ipodtouchacker
ipodtouchacker 11 months ago
When i Build and Run it goes to my second view, and i cant click on the button that i made. Whats happening?!
DeViliShChild1 11 months ago
Can you do this without a delegate.. I just have the viewController (.h and .m) with it's xib file. But I don't know if this will work because View Controllers don't have windows, just a view.
Thanks
nekbeth 1 year ago
IF you want to make 4 views how do you fix it? first to second to third to fourth?
wilenb03 1 year ago
Hi there, Great tutorial thanks,!
I am trying to make a soundboard, with a switch view, and I am able to make a switch view app, and a soundboard app, however I am having problems combining the two... can you help? please!!!?
Steve
3finsurf 1 year ago
I have realised it open the app on random pages. How do I get it to open on view 6?
AlfrescoProductions 1 year ago
In mine I have 6 views, but when I open (build and go) the simulator opens but the app thAt loads it just. White screen, how do I get it to show what I have done in the interface builder?
AlfrescoProductions 1 year ago
Comment removed
Gribbinb 1 year ago
Hi appleHack, I am a subscriber and really liked this tutorial. I am new at this, so maybe this is a stupid question, but how do you write the .h and .m files for the new views? Just make a new class file? For example if I wanted to play a sound clip or video clip on view 2, how is that done? i looked for other tutorials on this, but i think you are the only one that has broken the views down like this...brilliant by the way! I have been at this for weeks, and finally a tutorial that I get!
Gribbinb 1 year ago
Comment removed
Gribbinb 1 year ago
how do u do this doing a viewbased application?
ipodtouchacker 1 year ago
Comment removed
feinstimmer 1 year ago
Comment removed
feinstimmer 1 year ago
can you post a tutorial on UIPageControl pls.
( Can i switch views using page control... )
nts123456 1 year ago
Thank You very much
you save the day.
YOU ROCK bro....
nts123456 1 year ago
Thank You SO much!!!!!
I had been looking for hours how to do this (my first day with Xcode) and this was by far the best tutorial
Thanks again
TheForteEx 1 year ago
I found this an superb tutorial on how to make multiple views quickly but I have come across a problem worthy of another tutorial which know one seems to cover. If you build a project that has say 10 views and you navigate to say view 6 and you want to go back to view 5 how would you do this?
I have tried for hours (newbie) to get this to work taking reference from the way view2 goes back to view one but I don't seem to be able to replicate it on other views.
Any help??
Regards
FrankFlaps 1 year ago
@FrankFlaps
In your IBAction for your switch to view 5 button, you would do this:
[view6 setHidden:YES];
[view5 setHidden:NO];
and if you wanted to make sure all the views were hidden except 5, just to make sure, you would just do [view/*(Number)*/ setHidden:YES]; for each view.
AppleHack23 1 year ago
@AppleHack23 Thank you very much, that worked a treat and I understand it now. Thanks for the help, it is greatly appreciated!!!
FrankFlaps 1 year ago
@FrankFlaps all u gots to do is just make an IBAction and make to code go to the 5th page and link it up to the button you would like :)
kingofmagic1 1 year ago
im not getting the "Received Actions" at 3:03.
331319 1 year ago
@331319 Click on your Xcode window and press command + b at the same time on your keyboard. Then click save all. Now try.
AppleHack23 1 year ago
your an idiot this is not the easiest way to do it its alot more than 2 lines of code and it wont work with alot of people because alot of peolpe wont have the apdelegate because they arent doing this on their main view
madmax18765 1 year ago
@madmax18765 Do you listen at all? I said you can do this is any .m.
AppleHack23 1 year ago
When I try putting this in View, I don't have the app delegate...
SoopleGamer 1 year ago
@SoopleGamer Yes you do. It's your AppNameAppDelegate.h and .m. Or if you're talking about interface builder, then you need to open up your MainView.xib. This doesn't have to be done in the AppDelegate, it can be done in the ViewController.
AppleHack23 1 year ago
@AppleHack23 Ok. I found AppDelegate and put it in the APPNAMEViewController.xib and everything hooked up right. It loaded fine and when I click on the button, it crashes and returns to the home menu. I'll deploy this to my phone and see if it's just the simulator. Also I changed UIWindow to UIView since I have to have View application since I need it in landscape.
SoopleGamer 1 year ago
@SoopleGamer Didn't work... I'll see what caused the crash. I'll try and put it in viewcontroller.h and .m
SoopleGamer 1 year ago
@SoopleGamer Transfered the files to the viewcontroller.h and .m. I load it and it goes to a blank view. I added the -(void)viewDidLoad in viewcontroller.m and it still does that.
SoopleGamer 1 year ago
can you please make more videos please?
super8sean 1 year ago
Can you set animation/transitions when you are switching?? And would it be possible for you to post the source code? (maybe on your site)???
johnhmeyer123 1 year ago
quick question...
I got the view to work but when i run the simulator it doesn't open with the main window. Is there a way to choose which window opens first?
Lancewise 1 year ago
@Lancewise Open Interface Builder, click on your Window in your document, in the first tab of the Inspector, check of, "Visible at launch". If that doesn't work just comment again, and I'll have another answer.
AppleHack23 1 year ago
Comment removed
Lancewise 1 year ago
@AppleHack23 well it worked at first but now its doing it again. Simulator wont open with the right window even after I checked the visible at launch box. It seems to open the last window made each time if that helps at all. Thank you again for you help and you tutorial was very to the point and easy to follow btw.
Lancewise 1 year ago
@Lancewise In your .m, find a new space, and type the following.
-(void)viewDidLoad { [windowName setHidden:YES]; */do that for every window except the one you want to see at launch. Replace windowName with the name of your window./*
}
AppleHack23 1 year ago
Does this work with a view based?
BillyEatsPickles 1 year ago
@BillyEatsPickles Yep
AppleHack23 1 year ago
how did you get the iphoe screen on the demo god thing without jailbreaking or did you jailbreak
legoyokid1 1 year ago
@legoyokid1 Thats the iPhone simulator.
AppleHack23 1 year ago