Re: Binding "hidden" attribute
Re: Binding "hidden" attribute
- Subject: Re: Binding "hidden" attribute
- From: BareFeet <email@hidden>
- Date: Tue, 13 Oct 2009 01:43:09 +1100
On 12/10/2009, at 11:57 PM, Paul Bruneau wrote:
Yes, I have recently learned how to do this for my under development
app.
The tricky part in your case (and mine) is because your "ivar" is
not an ivar but a derived value returned by a method, you need to
tell the KVO system that. Here is my method:
+ (NSSet *)keyPathsForValuesAffectingSchemaIsHidden;
{
return [NSSet setWithObjects:@"query", @"source", nil];
}
Ooh, that looks complex, but worth noting, thanks.
I realise now tat your answer makes sense as a requirement if the
"type" in model object changes, otherwise there's nothing to trigger
the re-evaluation of the schemaIsHidden ivar. But in my situation, the
type is set when the object is created and never changes for that
object. So I don't actually need to handle KVO to that degree.
After further investigation, it seems that my approach works for my
situation, in so far as the schemaIsHidden value (returned by an
accessor method or stored in an ivar) is correct for the object's
type. The problem appears to be that the tab view item is not hiding
as I hoped it would. I'll repost this as a different question.
Thank you greatly for your response. It helped me realise my faulty
assumptions and better identify the problems.
Thanks,
Tom
BareFeet
_______________________________________________
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