can ttnavigator render a xib view in objective c? - three20

I have followed the three20 ttnavigator example in order to make my own app, but I have seen than the view is created in controller, but I would like to make my view in a xib file and then render it from controller when openURLAction is fired, how is it posible?, thanks

I used to overwrite the initWithNibName to make my view in a xib file, navigator openURLAction is ok.

Related

How to find the editor for multi view controllers

I am very new to xcode, got stuck in finding the editor to modify the code when created multiple view controllers. Whenever I click on any of the view controllers, I only see same editor contents and cant move to the others for coding.
I searched the web and stackoverflow but could not find a clear guideline on how to manage the editors for multiple view contollers. I have attached a snapshot.
You don’t “find” code. You create it.
When you drag a view controller into the storyboard, it has the default class of UIViewController. It is up to you to make a new code file where you subclass UIViewController, and then to go back to your storyboard and change the view controller to that subclass in the Identity inspector.

Xib file: Can't drag a View from a xib file to a swift file

I just dragged and dropped a View to a xib file. I added some constrains and tried to Ctrl drag from the View to a .swift file with the assistant editor, but it bounce back, what am I missing?
I was setting the View's custom class instead of the File's Owner. Once I set the File's Owner to the custom class, I was able to control-drag from the view in the storyboard over to my class. Hope this helps someone.
The xib file needs to be a subclass of the file you are trying to ctrl+drag to.

Connecting code to UI in storyboard with multiple ViewControllers, Xcode

I have a storyboard project in Xcode. I have added an additional ViewController and dropped in a button, text box, etc. I can get from the initial to the secondary View Controller, but I cannot seem to be able to connect the button to the code. I've tried adding additional classes with XIBs and even from a blank adding in the XIBs. How do I connect the code I have written for a button to do work on the second View Controller?
If you have the button created on the storyboard. You have to make an
-(IBAction)clickButton...
in the .h and .m code files. You can easily connect the code to the button by dragging the line from the dot (in front of the code name) to the button.
If you have created the Button fully in code. You have to specify which code to be executed on click.
[self.buttonName addTarget:self action:#selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
Here's the answer. You add new files to your project, and just for giggles, we'll call them NewViewController of the UIViewController class. Then, highlight the second view controller in the storyboard, choose identity inspector, and under Custom Class (at the top) you change the class to the name of the recently added NewViewController class. Now, all your code will connect to objects and so on. Thanks again for the help all and now I can rest in peace lol.

Xcode 4.3: how to create a nib linked to a view controller

Sorry, I'm quite new with xcode with a quite big project.
I upgrade xcode to 4.3.
I have a project (that doesn't use storyboard) and I need to add a view controller with a nib file.
Before upgrading I did File --> Ne File --> Cocoa Objective-C subclass and xcode created for me the m/h and their nib file.
Now that that option is disappear, how can I add a view controller?
I created the Objective-C class and, separately, a nib file, but how can I link the H/m files to the nib??
How can the m file call is nib??
Please can you help me? The project is real big and I can rewrite the code with the storyboard option!
Thanks
When editing your XIB, go to the Identity Inspector (it's the third button show in the following image). Then where it says Class, choose the controller you want to associate with the XIB.

I can't use the control drag function to hook up a button to action in .h when using storyboard with more than one view controller

Why can't I use the control drag function to hook up a button to action in .h when using storyboard with more than one view controller? Is there another way to do this?
Thanks a lot on beforehand!
Anton

Resources