XCode 3.2.6 Interface Builder Not Connecting - xcode

In interface builder my outlets and ibactions won't connect. They simply won't show up, like it doesn't exist.
Here is my code:
#interface RootViewController : UIViewController {
IBOutlet UILabel *time;
}
-(IBAction)changetime;
In Interface Builder the only two connections there are is:
view
searchDisplayController.
Please Help!

Had the same issue. Make sure you save (Shortcut: Ctrl+S) your .h before opening your .xib file.

Related

storyboard viewcontroller to coded viewcontroller

Is it possible to connect Storyboard ViewControllers with manual code-written ViewControllers? What I'm trying to do is make an app that, when internet connection is established, I see the viewcontroller made in the storyboard with tools given in the xcode (like the stepper, progress view, and etc) and when there's no internet connection, I want to access my coded viewcontroller that doesn't use the provided storyboard. How do I make the transition from the viewcontroller in the storyboard to the one not in the storyboard? Thanks!
UPDATE:Image depiction of what I seek to find:
depiction
I believe what you wanna do is show a storyboard programmatically?
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "ViewController")
window?.rootViewController = vc
Don't forget to add the "ViewController" identifier to the ViewController in your Interface builder.

What is the equivalent to UIViewController methodology for OSX?

I am new to OSX development.
Before storyboards on iOS, when you created a single view application, you would end with this structure:
AppDelegate.h
AppDelegate.h
ViewController.h
ViewController.m
ViewController.xib
The app would start on the delegate and call the xib and its classes, so the entry point to the app would be viewDidLoad inside ViewController.m
I have created an app for OSX. All I have is
AppDelegate.h
AppDelegate.m
MainMenu.xib
I would now to recreate something like the ViewController.h and ViewController.m and transfer control to something like a viewDidLoad, but I see this MainMenu.xib of cocoa has a window inside.
What do I do? Create a custom class for this window? I did not see any equivalent to viewDidLoad, viewDidAppear, etc. What is the equivalent for NSWindow or if this is now how it is done, please tell me.
The AppDelegate should have a applicationDidFinishLaunching which you can use as the entry point. the AppDelegate has a window associated with it by default. You can use AppDelegate to create the various features you would like to use. An alternative is to create a subclass of NSWindowController and have an associated xib for that which you can load when you want. Hope this helps.

Downgrading from Storyboard to XIB

So I understand that I can not use storyboard on anything less then 5.0. I have finished my App using storyboard only so am very basic to code.
I am going to re-create my app using XIB, I will create a new XIB file for each of my storyboards.
Want I would like help with is the code I need to cross-fade between each XIB. There will a button linking each XIB.
What do I need to add to ViewController.h and where do I put the code into ViewController.m
Thanks a lot for your help.
Bryce
This is what I use.
- (IBAction)changeViews:(id)sender
{
ModalViewControllerTwo *modalViewControllerTwo = [[ModalViewControllerTwo alloc] init];
modalViewControllerTwo.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[rootViewController presentModalViewController:modalViewControllerTwo animated:YES];
}

How do I change the image on a button I created in the Xcode interface builder?

Using xcode I have created an interface with several buttons, the problem I am having is that I would like to change the image on a button once it has been clicked. I understand how I would do this if I created the button programatically but no idea how to change an image that was created in the interface builder.
I don't really want to start from scratch and build the interface again programmatically so
if anyone could point me in the right direction I would appreciate it.
Thanks.
Use the button image property:
#property(nonatomic, readonly, retain) UIImage *currentImage
You will need to have established an IBOutlet connection to the UIButton.
Make sure your class has a corresponding UIButton property for the button:
#property(nonatomic, strong) IBOutlet UIButton *m_Button;
Then in the User Interface builder you can connect the button and the outlet.
In your code you can then access the button properties like you created it programatically.

Changing app to use a Tab Bar controller

I'm creating my first iPhone application (using XCode 4), and I initially created the project using the Navigation based application template. I've since decided that I want the UI to have a Tab Bar down the bottom with a Navigation Bar up the top, but am having difficulty changing my app to do that.
I added a new window to my app, and called it TabWindow.xib. I opened this up in Interface Builder and added a Tab Bar Controller. I then added an outlet property for the controller into AppDelegate.h as follows:-
#property (nonatomic, retain) IBOutlet UITabBarController *tabController;
This was synthesized in AppDelegate.m with the following:-
#synthesize tabController=_tabController;
I then changed the code in applicationDidFinishLaunchingWithOptions to the following (to switch out the old view controller with my new one):-
//self.window.rootViewController = self.navigationController;
self.window.rootViewController = self.tabController;
When I run the application, instead of seeing the Tab Bar view as expected, I see an empty window. I suspect I need to (at the very least) connect to the tabController outlet I created above, but I can't figure out how to do this. And is there anything else I need to do to get this to work?
You need to add the connection to the app delegate in interface builder. To do this, add an "Object" from the Object library and change its class to your app delegate. Then add the connections in the connections inspector.
Also, in your applications info plist file, you might have to set "Main nib file base name" to the new xib name.

Resources