• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: line break in Interface Builder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: line break in Interface Builder


  • Subject: Re: line break in Interface Builder
  • From: John Murphy <email@hidden>
  • Date: Thu, 4 Sep 2008 12:26:08 -0700 (PDT)

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@hidden> wrote:

> From: I. Savant <email@hidden>
> Subject: Re: line break in Interface Builder
> To: email@hidden
> Cc: email@hidden
> Date: Thursday, September 4, 2008, 7:20 PM
> 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

  • Follow-Ups:
    • Re: line break in Interface Builder
      • From: "I. Savant" <email@hidden>
References: 
 >Re: line break in Interface Builder (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Creating a runloop to handle specific mouse events
  • Next by Date: Re: line break in Interface Builder
  • Previous by thread: Re: line break in Interface Builder
  • Next by thread: Re: line break in Interface Builder
  • Index(es):
    • Date
    • Thread