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