This was actually my first thought as well, but I was hoping to avoid this technique because I am using this as part of a tutorial I want to remain in Interface Builder as much as possible for this particular lesson.
--- On Thu, 9/4/08, I. Savant <[EMAIL PROTECTED]> wrote: > From: I. Savant <[EMAIL PROTECTED]> > Subject: Re: line break in Interface Builder > To: [EMAIL PROTECTED] > Cc: Cocoa-dev@lists.apple.com > Date: Thursday, September 4, 2008, 7:20 PM > On Thu, Sep 4, 2008 at 3:14 PM, John Murphy > <[EMAIL PROTECTED]> wrote: > > I need to know how to create a line break in Interface > Builder. > > "\n" does not work... > > I have a multiline text field that is populated using > bindings, the value is modified using a display pattern: > > %{value1}@ %{value2}@ > > I need a line break between these two values. > > Any ideas? > > If inserting a \n escape doesn't work, my next > idea would be to > create a dependent key (dependent on whatever key you were > original > trying to bind) that gives the proper formatted string. > > Say you wanted to bind to two keys called: > "foo" and "bar". Create a > third key "formattedFooBarString" (or whatever) > and register it as > dependent upon foo and bar (so that if either foo or bar > change, > foormattedFooBarString is also updated). The key has no > setter, but > its getter returns: > > return [NSString stringWithFormat:@"[EMAIL PROTECTED]@", > [self > valueForKey:@"foo"], [self > valueForKey:@"bar"]]; > > You then bind to foormattedFooBarString (without using > the display > pattern) and it should work fine. I hope this helps. > > -- > I.S. _______________________________________________ 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 [EMAIL PROTECTED]