interface-builder

What is the difference between setting the delegate in Interface Builder vs using setDelegate:?

I'm trying to set the delegate for a scroll view using Interface Builder. If I have code like this: MyScrollViewDelegate * delegate = [[MyScrollViewDelegate alloc] init]; [scrollView setDelegate:delegate]; in viewDidLoad, everything works perfectly. If I open Interface Builder, add an NSObject and set the class to MyScrollViewDelega...

Why won't this program launch??

Hey all, I'm working through the Beginning iPhone Develoopment book and for some reason the project we're working on refuses to launch in the simulator, I think I've narrowed it down to something in the datePickerViewController.xib but heck if I know what is wrong, if I disconnect the uidatepicker outlet from the file's owner it works ...

Defining view layouts in one XIB, defining the views themselves in another

I have a main view with a controller and two seperate view controllers with their own xibs. something like @interface MainViewController : UIViewController { FirstViewController* firstController; SecondViewController* secondController; } I would like to have FirstViewController.xib and SecondViewController.xib so that I can p...

UIButton - should we release or not?

Ok. Let me explain the situation. I want to add a button on a view dynamically. Here is the code. UIButton *x=[UIButton buttonWithType:UIButtonTypeRoundedRect]; Here, I have not used "alloc" function. The questions for this statements are as follow. If we are using imageview for the same situation, we have to create an temp imagev...

Change view layout with orientation

Hi, I am working on an application where I want the view to change quite a lot when the device is rotated. I know that in Interface Builder it is possible to change the orientation and set up the layout there, however when I then rotate it to portrait, the view is the same as for the landscape. Is there a way to set up the two views inde...

How to see UITableViewDelegate in Interface Builder?

I have a UIViewController that I've added UITableViewDelegate to. This controller has a corresponding nib. I've associated the two in IB. However, the nib's File's Owner doesn't show the tableview delegate or datasource. I have a similar controller and nib where the tableview delegate shows up fine in IB. I can't see any differences...

Interface Builder: XIB Refactoring

Hi, is there a way to move a UITabBarController defined in the MainWindow.XIB in a separate XIB? I would like to load the TabBarController (RootViewController of my App) asynchronously while the user is stareing at the login screen to speed up the App launch time. Currently the TabBarController is loaded with the Main-Window and 'wired'...

Problem with multiple window/NIB cocoa application

I'm having a problem with my Cocoa app. I'm using my app delegate as a controller, and opening one window in a NIB file. Clicking a toolbar button opens another window from another NIB. Clicking save on this second window calls a method on the app delegate/controller. All this works fine. The strange thing is that I can't figure out...

error building the first program from Hillegass's book: Cocoa Programming for Mac OS X

I'm trying to build the first program in Aaron Hillegass's book: Cocoa(R) Programming for Mac(R) OS X (3rd Edition). The problem I'm having is that I can't my Interface object to "spawn" for lack of a better term unless I build and run the program. Herein lies the problem. While the program is running I can't connect the code to the int...

How to shrink/extend height of view according to the text

I have a UITableView, to which I add a Header-View, designed in InterfaceBuilder. This Header-View has two UILabels. The first label takes a title, that is always present. The second one displays a description, if present. Both strings can be quite long. Is there a way to extend or shrink this labels and the view so that the text is sho...

adding a footer overlay to the main window, to be shown over every subview, in an application using navigation controller

I'm working on an iPhone app where I'm using a navigation controller (UINavigationController) to navigate through the various child views, and I would like to add a uiview to either the main window or the navigation controller, as a footer overlay that shows up on top of all the child views. I've tried this through interface builder, an...

XCode iPhone SDK Interface Builder problem

Hi. I have a problem with my XCode project. (I am a noob at Objective-C and XCode, so please be patient with me..) I created a new project as a Tab Bar application. I created four new header, implementation and interface files, and added those as the sources in interface builder. They were in this format: FirstView.h/m/xib, SecondView....

Pressing tab in NSTextField selects all text instead of going to next control

I have multiple views all work fine but for some reason a view does not focus the next control when typing the tab key. Instead it selects all text of the current NSTextField. I am forgetting something really stupid here; can anyone help me on this? So it's an NIB containing a NSView. On the view are two NSTextFields, pressing tab in o...

Creating a UIView in Interface Builder that automatically centers itself when added as a subview

I created a UIView xib in Interface Builder and tried everything I could to indicate that the UIView should center itself, anchor itself at center, orient itself in central coordinates, etc. etc. But whenever I add it as a subview in code, I also have to programmatically set its frame up with CGRectMake() or else it will always add to t...

Can't create new xib files in Xcode projects

This one is a doozy... My buddy just downloaded the iPhone SDK on his Snow Leopard MacBook Pro. No matter what kind of project he creates (Window Based, View Based, etc...,) he can't create or use his own xib files. The project will compile and run fine until he adds a new xib file. Here are some symptoms: When he selects a pre-gener...

NSObjectController confusion binding to a class property. Help!

Hi, I'm teaching myself cocoa and enjoying the experience most of the time. I have been struggling all day with a simple problem that google has let me down on. I have read the Cocoa Bindings Program Topics and think I grok it but still can't solve my issue. I have a very simple class called MTSong that has various properties. I have u...

In IB why can you not add multiple Bar Button Items?

In Interface builder, create a UIView, then a UINavigationBar and then attempt to add multiple UIBarButtomItems to that Navigation Bar. The resulting hierarchy should be: - View - Navigation Bar - Navigation Item (Title) - Bar Button Item - Bar Buttom Item I can never seem to add the second Bar Button Item. I know...

UIView has no events

I want to be able to connect the touchUp event of my UIView to an IBAction, but I can't see any events. I thought that there was a subclass of UIView that did have actions. ...

Subclass of UIViewController initialising itself from a .xib can't use UINavigationItem?

Hi all, I've finally had to give up the relentless search for an answer to this question, as I just can't find anyone that's asked it before! So hope someone can provide some insight. I'll start by explaining what I can do, then compare that with what I can't figure out how to do. Suppose I have a custom VC called RootViewController. I...

Creating a view like iTunes's lyrics view in Cocoa

How do I create a scrolling text view like iTunes's lyrics view in Interface Builder for Cocoa? ...