Re: line break in Interface Builder
Re: line break in Interface Builder
- Subject: Re: line break in Interface Builder
- From: "I. Savant" <email@hidden>
- Date: Thu, 4 Sep 2008 15:20:19 -0400
On Thu, Sep 4, 2008 at 3:14 PM, John Murphy <email@hidden> 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:@"%@\n%@", [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 (email@hidden)
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:
This email sent to email@hidden