On Dec 10, 2009, at 14:21, Patrick J. Collins wrote:

> I would like to expand on this and make it a little more interesting and
> challenging, but I don't know how to do what I am thinking-- which is:
> 
> Create a button which will insert a new label/text field.  This action also
> needs to dynamically generate an instance variable in my model file for the
> text of the new textfield, as well as generate an IBOutlet in my controller.

But why? In the exact terms you've used, this is not a pattern you're likely to 
use in any practical application. Although Objective-C is in many senses a 
dynamic language, this particular kind of dynamism is not usual in most 
applications.

If there's only one "new" label, then you might as well go ahead and design it 
into your code and your interface to begin with (even if it's hidden 
initially). If there might be an arbitrary number of new labels to show in the 
interface, you might use an NSArray or NSDictionary instance variable to hold 
the values, and a NSTableView to display them.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to