• 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: Value Transformer with multiple Model Key Paths
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Value Transformer with multiple Model Key Paths


  • Subject: Re: Value Transformer with multiple Model Key Paths
  • From: Mikael Wämundson <email@hidden>
  • Date: Mon, 31 May 2010 00:27:49 +0200

Yes, this is my implementation:

@implementation TextColorValueTransformer

+ (Class)transformedValueClass
{
    return [NSColor class];
}

+ (BOOL)allowsReverseTransformation
{
    return NO;
}

- (id)transformedValue:(id)value
{
	BOOL theBoolean = [value boolValue];

    if (theBoolean) {
		return [NSColor blueColor];
    }
    return [NSColor blackColor];
}

@end

30 maj 2010 kl. 23.13 skrev Reinhard Segeler:

> Did you subclass the NSValueTransformer class for that purpose?
>
>
> -- Reinhard
>
> Am 30.05.2010 um 21:51 schrieb Mikael Wämundson:
>
>> Hi,
>>
>> Problem is the following:
>> I want to set the color of the text in each line in a TableView depending on two attributes of the object: one boolean and one integer. If the boolean is true all text for that line in the TableView is to be colored blue, if the integer is zero all text is to be colored red.
>> In IB i've bound the TableColumns Text Color using the boolean as Model Key Path and a Value Transformer setting the text color to blue.
>>
>> Now, how do I setup a Value Transformer bound to the integer attribute and a Value Transformer?
>>
>> Thank you!
>> /Mikael
>>
>> _______________________________________________
>>
>> 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: Value Transformer with multiple Model Key Paths
      • From: Reinhard Segeler <email@hidden>
References: 
 >Value Transformer with multiple Model Key Paths (From: Mikael Wämundson <email@hidden>)
 >Re: Value Transformer with multiple Model Key Paths (From: Reinhard Segeler <email@hidden>)

  • Prev by Date: Fwd: UIView retain past drawing?
  • Next by Date: Re: Notification of file system modification arrives too early?
  • Previous by thread: Re: Value Transformer with multiple Model Key Paths
  • Next by thread: Re: Value Transformer with multiple Model Key Paths
  • Index(es):
    • Date
    • Thread