Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obtaining a reference to an entity's context's owner




I think we're crossing wires somewhere here. :-D

I asked if the Keyword class should do all the work (ie, find all Page instances whose content string contains the modified Keyword's word string, then flag it as needing sync). You said yes, but the rest of your answer indicates a resounding no. ;-)

Okay, let's back up a bit. Right now, my Keyword class 'wants' to tell the MyDocument class to -touchPagesContainingKeyword:self ... this method cycles through all the Pages, accesses their content property and does a basic string search for the modified Keyword's "word" string. If the Page content contains the keyword, its "-touch" method is called (which modifies a few properties including mod date, and needsSync flag.

I'm beginning to question this approach. I'm not talking about using a fetch request but maybe I should be. Is this where my problem lies?



On May 5, 2005, at 1:56 PM, mmalcolm crawford wrote:

It does make me think, though - should the Keyword class itself do all the work here, rather than ask the document to do it? That *should* negate the need to talk directly with the document itself altogether. Is that the right direction?


Yes. As a controller, it's aware of when modifications are being made and is able to coordinate responses to changes. It's not up to the Keyword to act as a controller in that way.



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Obtaining a reference to an entity's context's owner (From: SA Dev <email@hidden>)
 >Re: Obtaining a reference to an entity's context's owner (From: mmalcolm crawford <email@hidden>)
 >Re: Obtaining a reference to an entity's context's owner (From: SA Dev <email@hidden>)
 >Re: Obtaining a reference to an entity's context's owner (From: mmalcolm crawford <email@hidden>)
 >Re: Obtaining a reference to an entity's context's owner (From: SA Dev <email@hidden>)
 >Re: Obtaining a reference to an entity's context's owner (From: mmalcolm crawford <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.