Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

danewithoutwax

macrumors newbie
Original poster
Aug 19, 2010
15
0
I'm still pretty new to programming and object c. I got all my code written now, but how do i create a interface/design for the app? I know how easy it is to do when creating iPhone apps, but i can't seem to figure out how to do it with normal applications?
 
I'm still pretty new to programming and object c. I got all my code written now, but how do i create a interface/design for the app? I know how easy it is to do when creating iPhone apps, but i can't seem to figure out how to do it with normal applications?

Same way as do for the iPhone apart from the fact that Mac OS X interfaces tend to be much more complex than iPhone interfaces and can (and most likely should) span several XIB files.

Just open up Interface Builder and have at it. Then hook up the interface objects with your code.
 
Same way as do for the iPhone apart from the fact that Mac OS X interfaces tend to be much more complex than iPhone interfaces and can (and most likely should) span several XIB files.

Just open up Interface Builder and have at it. Then hook up the interface objects with your code.

How do i hook it up?
 
It is pretty much exactly the same as the iPhone.

I've only seen someone work with the iphone build interface, i've never actually tried it, so i'm sorry, but i don't know what you mean by that.

I have created my desired interface.
 
Last edited:
I've only seen someone work with the iphone build interface, i've never actually tried it, so i'm sorry, but i don't know what you mean by that.

I have created my desired interface.

Might not cover everything, but let's take a stab at it.

You're going to want to create a view controller for your interface winder that is a subclass of UIViewController ( MyFirstViewController : UIViewController).

Then in Interface Builder hit Cmd+0 to bring up the Document Window. Click on File's Owner, then press CMD+shift+i to get the info window to come up. Hit the rightmost tab and set the identity of the File's Owner to the view controller class you just created.

Now, go back to your h file for your class and create ivars for every outlet you need. For example:

IBOutlet UILabel *myLabel;
IBOutlet UISlider *mySlider;

If you go back to Interface Builder and right click on File's Owner, you should see outlets now for these new vars. Drag from the outlets to the actual UI elements.

Good luck!
 
Hooking Up

Hooking up (as the kids say) will take you some time to get your head around. You'll need to spend a few hours/days going through some tutorials on how Xcode, Objective-C, and Cocoa view code and the user interface.

It's not as simple the old days, where you'd just put a statement in the code like CreateWindow(100, 150, 75, 75); and when that line was executed the window would be created. Now you create the window in Interface Builder, then "hook it up" to your code using the IBOutlet processor commands.
 
Hooking up (as the kids say) will take you some time to get your head around. You'll need to spend a few hours/days going through some tutorials on how Xcode, Objective-C, and Cocoa view code and the user interface.

Agreed! It took me a while to get enough of Interface Builder figured out to be comfortable using it, but it gets the job done now fine.

It's not as simple the old days, where you'd just put a statement in the code like CreateWindow(100, 150, 75, 75); and when that line was executed the window would be created. Now you create the window in Interface Builder, then "hook it up" to your code using the IBOutlet processor commands.

It is nice to not have to create everything programmatically though! :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.