Why does TwoViewAppViewController.h have a member variable "theLabel", and why is it linked in the layout editor? It is not used in the actual source code, but if I comment it out (project still compiles) but the app crashes immediately. It seems a bit odd to me that there is also a "theLabel" member variable in MainView.h as well - which is actually being used, the one in the view, or in the controller?
Thanks for the tutorial aoberoi makes a good point, but it is hard to stick to solid MCV without adding a lot of fluff, I guess that just depends on well thought out modular design, Apple seems to have done quite well so far with it
Your tutorial has been very helpful, though I have been struggling trying to get some changes to it to work. How would I go about making it so that when they choose the color, when the window flips back to the front, the color has already changed without pressing the "say hi" button again?
Is there a way to stay within this framework, and create "flipHome" method that can be used generically for many different view controllers ... for example in the following code:
This particular code works if I call it from my goWebController.m file.
However, if I want to use the same method from multiple view controllers, to just send me home to the main screen, can I change the line
Code:
[[goWebController view] removeFromSuperview];
to something like
Code:
[[sender view] removeFromSuperview];
^ I tried that specific code, but it didn't work. I am just trying to figure out all the guts of this and understand how all the pieces work together here, using the same calling method as was used in your tutorial when I click on a "back" button.
Thanks for any advice/tips/understanding you can offer!
First of all thx for the guide it was such a great help… I got it to work perfectly, I tried taking it to the next step and I was able to add as many views as I wanted, but I got stocked when I tried to add a uitableview..
thanks very much for the tutorial, I'm experiencing a problem however, i used your logic for my own application with a menu system, and any viewcontroller i change to that is not the root view is off centered (everything is shifted up like 20 pixels.)
its possible to reload a image when i switch to a view again?
Because the image displayed after 5seconds. But when I again switch to the view, only the sound plays but not the image is showing!
Should i have to do that with the method viewDidDisappear?
Thanks for the tutorial aoberoi makes a good point, but it is hard to stick to solid MCV without adding a lot of fluff, I guess that just depends on well thought out modular design, Apple seems to have done quite well so far with it
I found this thread while doing some investigations for my blog, where I post iPhone-tutorials as a way of learning the iPhone API - writing tutorial forces me to really understand stuff
The thread actually inspired me to write a two-part tutorial on a similar subject - how to handle multiple user interfaces and being able to "exit" the or switch between them:
hey myersn, can i ask you a few question? im very new to xcode and obj-c and all.. so if i asked the question wrongly.. im sorry... i only learnt this coding in like 6 weeks through online tutorials and all with no background of obj-c or what-so-ever... im more familiar with window based programming.
i cant view the tutorial yet due to slow connection in my college, so i went straight to the source code before watching the tutorial... so if there are explainations there, i cant hear it..
in your twoViewAppAppDelegate, what is the difference between [self.window addSubview:[secondViewController view]]; and [window addSubview:secondViewController]; ?
in most online tutorials, i've seen people doing it the [window addSubview:secondViewController]; way..
another question would be, in either SecondView.xib or TwoViewAppViewController.xib if i would to add another view to either xib, can i call it? because i was experimenting it and my output is nothing. but my build is successful with no warning nor errors..
i seriously need help understanding xcode real soon, the only help i can get is through online materials..
thanks in advance
Last edited by lxLionHartxl; 05-28-2009 at 04:11 AM.
I was following this tutorial and everything is working perfectly. I was trying to add 3rd view with the same code and the app crashes. The button after press stays blue 2-3s and app crashes. It's in separate action...Iam I not able to do "main view" and from this link another 5-6 flipping views?
Thanks for ideas and your time!!!
I was following this tutorial and everything is working perfectly. I was trying to add 3rd view with the same code and the app crashes. The button after press stays blue 2-3s and app crashes. It's in separate action...Iam I not able to do "main view" and from this link another 5-6 flipping views?
Thanks for ideas and your time!!!
For a minute there I thought he was asking about my tutorial on the same subject...
Hmm...realize that this tutorial is dated. I also have a similar tutorial on this site, try it too, but realize it too is outdated.
I'd suggest you browse through my chapter 8 or 9 videos on Vimeo. These don't have sound, but if you have completed this tutorial then you should have no problems following them. Moreover, source code will be posted for all the book videos (by August I will have them all).
BTW, not trashing this tutorial, the author of the tutorial was actually my technical editor/reviewer for the iPhone Book I just wrote and will be the editor/reviewer of the Objective-C book I'm about to write.
Oh, about your question, my guess is you need to go into the xib and ensure you connected all IBOutlets...I'll bet you didn't connect the File's Owner view IBOutlet to the view in the xib...common error if doing things the old-fashioned way.
Last edited by jamesbrannan; 07-10-2009 at 10:15 AM.
Hi, thank you for your reply. And yes I did (I believe) connect the xib view and File's owner view. Have a look in attachment if you're interest. I just can't manage to make it work...ignore the tab bar - which is not working yet as I can't flip the views to check the functionality...it's just there for now.
Thank you for your time!!! I lost already few days with this and trying to understand the connections. Tried few different codes - no errors by Building, but the same result...I attached the file below
Hmm....I haven't looked at his tutorial in probably a year, but anything that says "flipview" in it is probably *very* outdated. See this video (no sound), it uses multiple xibs as a matter of course. Be patient, takes awhile to get playing, but it does play. It is also designed to go with my upcoming book's written instructions, "iPhone SDK Development:A Beginner's Guide", but should be followable as a stand alone video tutorial.
I'm working on getting the privacy feature to work, it should allow iphonesdk, but doesn't seem to work right yet. For now I apologize, you must go to the vimeo site.
Thank you James for your help. I did watch and wrote down all source code of the easy app CH9 Duplicating the Utility Application. Looks very easy. I followed step by step tutorial, did exactly the same as you did in the video. All connections and code are done same way -> Build Successful! Great! No errors. Build & Go -> button stays pressed 3s - stays blue and window will disappear...it crashes. I have cleaned the Xcode cache and tried again...crashes again. I really don't know what is the problem. Maybe something with Xcode? Debug is set for 3.0
Any ideas? Weird, huh...?
I have checked the debugger and it stops on line 11 -[FirstViewController showDetails:] and the red arrow is pointing on source code
[self presentModalViewController:self.second animated:YES];
0x302ac924 <+0004> leave
GDB: Interrupted
Any ideas what to do with it? I was following step by step the tut and have exactly the same code and connections. I don't understand...
I have checked the debugger and it stops on line 11 -[FirstViewController showDetails:] and the red arrow is pointing on source code
[self presentModalViewController:self.second animated:YES];
0x302ac924 <+0004> leave
GDB: Interrupted
Any ideas what to do with it? I was following step by step the tut and have exactly the same code and connections. I don't understand...
Did you add a .xib by accident to the nib name? does the code directly preceding the line look like this this?
I ran the code again and it works fine. If I screw up the line shown above, then I to have the debugger stop on the same line as you, so my guess is that there is something wrong with this line. BTW, my site isn't up yet, working on it, but in the interim, send me a private message and I'll email you the completed project. You do have 3.0 right?