• 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: Problem binding NSTextView's attributedString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Problem binding NSTextView's attributedString
      • From: "Pete Callaway" <email@hidden>
References: 
 >Problem binding NSTextView's attributedString (From: "Pete Callaway" <email@hidden>)
 >Re: Problem binding NSTextView's attributedString (From: Negm-Awad Amin <email@hidden>)
 >Re: Problem binding NSTextView's attributedString (From: "I. Savant" <email@hidden>)
 >Re: Problem binding NSTextView's attributedString (From: "Pete Callaway" <email@hidden>)

  • Prev by Date: Re: compiler warning for not fully implementing protocol
  • Next by Date: Re: [Q] [NSValue valueWithBytes: objCType:]
  • Previous by thread: Re: Problem binding NSTextView's attributedString
  • Next by thread: Re: Problem binding NSTextView's attributedString
  • Index(es):
    • Date
    • Thread