interface-builder

Bindings MInefield in Xcode and Interface Builder.

All right, after having worked through Cocoa Dev Central's "Build a Core Data Application" tutorial I started experimenting with building my own application, using the code and .nib file from the tutorial as a reference to make sure that things are put together properly. Overall I've been managing pretty well with it, however I seem to ...

iPhone Interface Builder - Moved resources to sub-directory, now IB can't see them!

I had a bunch of images in my Xcode project. They were originally added without choosing "Create Folder References for any added folders". So I removed the references and re-added as per these instructions http://stackoverflow.com/questions/1401338/include-a-resource-directory-hierarchy-into-app-bundle Unfortunately, Interface Builder w...

How do you change which view is active in a window?

The program I'm working on right now is a bit cumbersome, as it starts with a central menu, and then once the user chooses an option from it it opens their selection in a new window, when I've got a perfectly good window I can (at least apparently) repurpose to that effect. I've been reading the manual regarding views, and I understand ...

Closing old window when opening a new one in Cocoa

Ok, I have two windows, A and B. When I click a button on Window A, I want it to close and take the user to Window B. makeKeyAndOrderFront does a great job of activating Window B, but how do you get it to then close Window A? ...

Designing the iPhone interface in a nib or in code?

I've been pondering over this question for a long time already. On the one hand, Interface Builder offers a really easy way to design the interface and wire the elements up with objects in code. On the other hand, in larger projects, Interface Builder becomes a hassle to maintain. Any suggestions would be greatly appreciated. ...

iPhone ModalView with Table Not Displaying

App Description: I have a UIWebview and a Toolbar beneath it. A button (Menu) on the toolbar should bring up a modal table view, but it does not. Problem: The button runs through the code (tested with breakpoints and replacing the code) but doesn't display the alternate View. My Hunch: It's probably a relationship problem in Interface ...

Test build of Cocoa application not compatible with tester's version of OS X.

I've been building a basic Cocoa application with Core Data and Interface Builder, and no extra coding, frameworks, or header files. I sent it to someone to test on their machine (a last-gen G5 iMac), and they got a message saying that their machine couldn't run it. I discovered the switch to compile for PPC, so I built a PPC version o...

Memory Management of Interface Builder Outlets

I am using @property(nonatomic, retain) for my IBOutlets for an iPhone application. However, I'm not sure how to make sure I'm managing memory with them properly. The IBOutlets are all set up in Interface Builder, so I'm never calling alloc manually. This means that I'm not sure when and if to deallocate them or when to set them to point...

how to initialize UITableView? Both from XIB and programmatically?

Hi all, I have a simple request that I have spent much time on (embarrassingly).. I have sub-classed a UITableView to add some functionality. These new features require things like NSMutableSet which require allocation/initialization. I have put my object's initialization routine in - (id)initWithFrame:(CGRect)frame style:(UITableVie...

Core Data Relationship Fault

Tracking a familial relationship in Core Data (1 parent entity + 2 types of children, one of which is recursive), trying to create a drop-menu in Interface Builder that lists the names of the parent entities so that the user can choose one to associate as the parent of the entry being edited. I've got the bindings all set, but when it r...

Accessing nib/xib objects from controller.

Hi! I have a UI file in xcode, and I have an AppDelegate class with an awakeFromNib function. From this function, is there a way to change properties of objects which are in the UI? For example, change the string of a label, textfield and so on. Sorry for bad english, tried to explain as well as I could. Any help would be very apprec...

PushViewController now crashes

In some working code, I had a call to PushViewController, which loaded (successfully) a new view from an xib. I went into the XIB and added a couple of buttons. Retried the code, and the view continued to be displayed at the appropriate point in the code. I then deleted those buttons, and since that point, the code no longer works. It ...

Calling up a specific record in Core Data

I'm setting up an edit window for a player to edit his user data. I've got all of the fields on the edit form bound to the appropriate Core Data entity (via an NSArrayController), and I've got an awakeFromNib method installed to handle calling the record, but I'm not sure what to put inside the method to get the record to display. Ulti...

Allow 0 values in NSDatePicker fields?

Is it possible to modify an NSDatePicker object to allow for 0 values in the month and/or day columns? Dealing with a situation where the specific day in particular is non-essiential but nice to have data (and data which the user likely doesn't know offhand to begin with). ...

Filtering entries from a Core Data entity that appear in an NSPopUpButton list

I'm familiar with how to feed data from one Core Data entity into an NSPopUpButton item so that it can be selected for another. Bindings like so: For the values themselves: -> ValueSelection.Content Bind To: Value Source Entity Controller Key: arrangedObjects Model Key: N/A For the values displayed in the NSPopUpButton: ...

Allowing the user to submit images within a Cocoa application

How do you set up an object in interface builder that will allow the user to submit an image (like when editing a vCard in Address Book) and save it to the corresponding entry in the database being managed by Core Data? Solution Use an NSImageView object. On the first panel of the inspector for the object, you'll see a checkbox marked...

Tinkering under the hood with Bindings in Xcode

Let's take two Core Data entities, set up as follows: Entity A: Car Attributes: year model Relationships: manufacturer (<<-> Manufacturer) Entity B: Manufacturer Attributes: name country Relationships: cars (<->> Car) Now, what I want to do is bind the display to an NSTableView where we have the model of th...

Centering Windows on screen

Short and sweet: How can I tell Interface Builder to center a window on a user's screen? I've seen the positioning tool on the inspector, but eyeballing doesn't always land as squarely as I like. Is this something where I should switch over to Xcode and add something to the init or awakeFromNib methods? ...

Relationships vs. Attributes in Core Data

Overall I'm loving Core Data so far, but there is one quirk in the system that I keep coming back to, and that's problems created when I decide to use relationships instead of attributes. Using cars for an example, let's say I have a Car entity and a Manufacturer entity. Ideally, I can just put a relationship between them, many cars to...

Setting Horizontal Line (NSBox) line width in Interface Builder

I have an application that I am building am making use of Horizontal Line (which is just a special case of NSBox). I've placed the component into the interface, but what to adjust the thickness of the line. NSBox has a setBorderWidth method, but doesn't seem to have this exposed when in Interface Builder. I would prefer not to do this ...