• 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: MultiBinding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MultiBinding


  • Subject: Re: MultiBinding
  • From: Gerd Knops <email@hidden>
  • Date: Mon, 28 Oct 2013 12:52:52 -0500

In Interface Builder text fields you can use "Value with Pattern" to combine multiple properties into a single output. Alternatively in code you can do something like this:

- (NSString *)fullName {

	return [NSString stringWithFormat:@"%@, %@",self.lastName,self.firstName];
}
+ (NSSet *)keyPathsForValuesAffectingFullName {

	return [NSSet setWithObjects:@"lastName",@"firstName",nil];
}

Gerd



On Oct 28, 2013, at 11:41 AM, email@hidden wrote:

> Has anyone any suggestions for how to implement something similar to XAMLs MultiBinding class?
> Essentially this enables multiple bindings to be combined through a transformer to produce the final view output.
>
> http://msdn.microsoft.com/en-us/library/system.windows.data.multibinding.aspx
>
> <TextBlock Name="textBox2" DataContext="{StaticResource NameListData}">
> <TextBlock.Text>
> <MultiBinding Converter="{StaticResource myNameConverter}" ConverterParameter="FormatLastFirst">
>    <Binding Path="FirstName"/>
>    <Binding Path="LastName"/>
> </MultiBinding>
> </TextBlock.Text>
> </TextBlock>
>
> Jonathan
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
> 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


_______________________________________________

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: MultiBinding
      • From: "email@hidden" <email@hidden>
References: 
 >MultiBinding (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: OBJC_PRINT_REPLACED_METHODS logs a lot of noise?
  • Next by Date: Re: MultiBinding
  • Previous by thread: MultiBinding
  • Next by thread: Re: MultiBinding
  • Index(es):
    • Date
    • Thread