How do I add a new view to a single view application in Xcode - objective-c

I started my app as a single view application. I have the view with various buttons and labels connected to code. I want to add a button that links to another view.
I found a tutorial that guided me to click on the project and add a UIView subclass. However there is no option for that ( I think because I started it as a single view application).
I'm pretty new to all this so if anyone can outline a simple way for me to do this that would be great! I am using Xcode version 4.3.2.
Thanks!

You need to add a new Objective C class. Please refer to this:
How to create new View Controllers in XCode 4.3

If you started the app as single view using xib file the to add a class just go to name of the project on the left pane and right click on it. Then choose add new file. The pop up will appear to allow you to choose what type of class you want to add. Depending to what the new view is you can choose uiview controller or uitableview controller and so on. Just make sure you check mark with xib for interface user. That should do it. Hope it helps.
Adrian

Related

Linking View Controller to Storyboard objective c

I know that this should be very easy but I haven't been able to find out how to do it. The suggestions that I have do not work. I basically have a view controller in my storyboard and I want to link it to a MyController.m file which I created manually.
I was wondering what the proper way of doing that is. Thank you in advance.
Click on the viewController which you want to associate with that
specific class.
Go to the utilities pane (right-most column, where properties etc
are found).
On the identity inspector (3rd tab from left), you will see a
section called custom class.
Fill in the name of your class there.

Master/Detail Application : Add a second Split View Controller to the Detail View

I have a MAster/Detail Application and everything is fine. Now when loaded, we have the Button Named "Master" That will slide over the original Master View Controller. I want to change it's behavior ,so instead of popping over the original MasterViewController..i need it to popOver another SplitViewController with the option of going back to the original one. Any ideas how to create this? I dunno where to start. Any ideas will be highly appreciated
Please Check This Edit
Edit 1 :
To be more precise...i have a dictionary application that first loads all the elements in the master view controller on the left...once i click on any element, it will open up in details view controller as it should.
Once in the Details view controller..if i click on Add to Favorites button...and click on the button Show Favorites...i need it to show me in the MasterViewControlle all the selected favorites instead of all the dictionary elements...how can i do it?
Seeing your question i feel you want to have UISplitViewController like below.
I never worked on it but try out this tutorial and try to integrate this feature in your project.
Raywenderlich tutorial link Click here
UISplitViewController class reference Click here
check this Question already asked in stackoverflow if you want to use protocol objectiveC protocol issue Detail -> Master communication.
You can use KVO as well.Check this Link : http://2pi.dk/tech/cocoa/kvo_dispatch.html

How to associate new class files to be a view controller for a specific scene?

Alright, I will try and make this short and sweet. I recently created my first iOS app, and in my app I decided to go the storyboard route by selecting the checkbox when creating the project. On a side note, I recently just started developing in Xcode, keep that in mind. So I started by designing the GUI elements of my app, and before I knew it, I had 8 scenes in my storyboard file and one view controller. Needless to say the view controller has been populated with code from different scenes thus making it difficult to understand what does what in the view controller. In the spirit OO design principles, I thought it would be a good idea to create a separate view controller for each scene. So I created some class files for the project. When I try to associate the newly created class file with the scene my computer just sounds a beep / donk sound. I am trying to associate the newly created class file to a scene by selecting the scene in the storyboard / Interface Builder view, then displaying the Utilities pane on the right, then selecting the Identity Inspector at the top of the Utilities pane, then setting the Custom Class to my newly created class file, but when I type the name of the class and press enter I just hear a beep.
If any one has any insight or knows of a tutorial explaining this process please post. Part of the reason I am trying to do this is for code readability, better code management, and a better code structure for the application. I came across this stack thread explaining some of what I am talking about.
Also here's a picture of what my project looks like if that helps shed any light.
You need to consider the parent class of your controllers, UIViewController for example.
To do so, you must check the .h file and your xib/nib file.
I. In your .h file, you will be seing:
#interface ViewControllerWelcome : NSObject
Change 'NSObject' to 'UIViewController' - this will mean that ViewControllerWelcome has a parent class UIViewController.
II. In your nib/xib file:
1. Click on the controller that you are going to set from the storyboard.
2. Go to interface builder and click the "Identity Inspector" (third item from the left) from the Utilities panel.
3. You need to specifically set each controller's name (eg. ViewControllerWelcome)
Do these to all controllers from your storyboard.
Here's something you can read about ViewControllers and Storyboards.

Xcode 4.3 Black screen when adding tab page

I'm trying to make a tab page based application in Xcode 4.3. First step is to add more view controllers than the 2 already there.
I drag a view controller form the library, then ctrl+drag from the tab controller, finally i create new UIViewController h and m file - named "CalenderViewControl" and select that name in the filesowner for my new added Viewcontroller.
Now everything seems fine in design - i have a new tab, referring to my new page.
but.....
When i run the simulation and select my new page tab, the page is all black, and nothing happens.
I have tryed to connect the file owners view to the view of the view controller - without any luck.
What I'm i missing....?
Ulrik
The reason is because you need to delete a method in your .m file of your new view controller.
Just add some comment to the method called (void)loadView and you will see your new view controller display.
I hope to have been useful, I was stuck on that for a day and I finally figured out how to do it.
Good Luck!!

steps required to add a UITableViewController as the detail view of a splitView application

I am becoming one sad stackoverflow-er (not flower ) :S
I would like to know the explicit steps required to add a UITableViewController as the detail view of a splitViewController using xCode and Interface Builder. This is an iPad application, so it does not have to run on the iPhone
I have gone through a number of tutorials that create UISplitViews, so I understand the concept. But each of these tutorials add a webview, or simple view controller that shows an image.
The left side of the split view shows a list of menu items that I can customize. that's the popover. no problem.
the right side needs to be a UITableViewController that I an descend and ascend that will have menu items based on the button clicked on the left hand popover.
I also looked this link - http://www.cimgf.com/2010/05/24/fixing-the-uisplitviewcontroller-template/ but the discussion appears to note that it's a "hack" rather than an recognized workflow.
anyone help a brother programmer out? steps are appreciated.
regards,
Edard
Check out any of the examples on the net. Then take the detailViewController and turn it into a UITableViewController.
Alternatively, you can check out the UISplitViewController Class Reference.