Re: Problem binding NSTextView's attributedString
Re: Problem binding NSTextView's attributedString
- Subject: Re: Problem binding NSTextView's attributedString
- From: Quincey Morris <email@hidden>
- Date: Thu, 31 Jul 2008 13:42:05 -0700
On Jul 31, 2008, at 13:02, Pete Callaway wrote:
- (void)setSelectedPage:(PageEntity*)newPage
{
if (newPage == _selectedPage)
return;
[self willChangeValueForKey:@"selectedPage"];
_selectedPage = newPage;
[self didChangeValueForKey:@"selectedPage"];
}
- (PageEntity*)selectedPage
{
// Probably OTT
[self willAccessValueForKey:@"selectedPage"];
PageEntity *page = _selectedPage;
[self didAccessValueForKey:@"selectedPage"];
return page
}
So this is a Core Data application? If so, is "selectedPage" a
property defined in the Core Data model, or not?
If it is, you probably should be using primitiveSelectedPage and
setPrimitiveSelectedPage to access your instance variable. If not,
you're using a property behind Core Data's back, and I didn't have
great success when I tried doing that -- though I expect it is doable
and I was just Doing It Wrong. (Also, will/didAccessValueForKey makes
no sense for properties not in the Core Data model, AFAIK.)
Or, you may be looking in the wrong place for the problem. Are you
sure that PageEntity is KVO compliant for the property "stringContent"?
_______________________________________________
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