views:

28

answers:

1

I'm trying to create an vocabulary study application using Obj-C and the Cocoa frameworks. I have about two week's experience in both areas and have reached an edge of my current knowledge.

Here's where I'm stuck. When I press a checkbox, a corresponding plist is loaded into memory as an NSDictionary. I want to generate a "Label: Textfield" pair for each key:value pair, where the Label is the key. When the text typed into the Textfield matches the key's value, I want the Label's text to turn green.

So how would I generate this grid, and once generated, how would I make the text green upon correct input?

Thanks!

A: 

I want to generate a "Label: Textfield" pair for each key:value pair, where the Label is the key. When the text typed into the Textfield matches the key's value, I want the Label's text to turn green.

So how would I generate this grid, …

NSForm.

… and once generated, how would I make the text green upon correct input?

Set the relevant form cell's title to an attributed string with the key in green.

Peter Hosey
So do I just allocate an NSForm and then use the addEntry for each item in the dictionary? How does IB know how to draw the grid?
SteveStifler
IB doesn't draw the grid in your application; IB is a separate application. Views draw themselves, and NSForm is one of the many view classes. I would suggest creating the NSForm object yourself (in code, not in IB) since you're not going to have it pre-filled with values. See the View Programming Guide for more info: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaViewsGuide/
Peter Hosey