• 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: EditingContext/Sorting Problem SOLVED
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EditingContext/Sorting Problem SOLVED


  • Subject: Re: EditingContext/Sorting Problem SOLVED
  • From: "John Huss" <email@hidden>
  • Date: Tue, 3 Apr 2007 10:24:00 -0500

I had this problem a while back.  It might be overkill, but I modified
by eogenerator template to make the methods FINAL so that I would
never make that mistake again.

John

On 4/3/07, Robert Walker <email@hidden> wrote:

Okay. I've given the method a new name and it is working perfectly now. I'm assuming that this applies to filtering the array of related objects as well. Yes?Yes.


BTW, did I miss something in the documentation where it tells you not to override these? I have several WO books as well, and while the examples always show using a separate method, they don't say it's required.

If you were to look deeper at the array return by the relationship methods
you would find that they are not simple immutable arrays like the return
type indicates.  They are treated internally as something like
XXCheapCopyMutableArray or some such beast (I can't remember the exact class
name).  Then the reference to that gets returned to you cast to a basic
NSArray.  Maybe that has something to do with the problems of overriding
those methods in a subclass.  I'm not really sure of the internal mechanics
of EOF.  I just know not to override those methods, but rather use the
technique give in the previous response of providing a new method that makes
use of the original method.


On Apr 3, 2007, at 10:59 AM, David Avendasora wrote:

Okay. I've given the method a new name and it is working perfectly now. I'm
assuming that this applies to filtering the array of related objects as
well. Yes?

BTW, did I miss something in the documentation where it tells you not to
override these? I have several WO books as well, and while the examples
always show using a separate method, they don't say it's required.

Thanks again for the help everyone!

On Apr 3, 2007, at 9:51 AM, Ken Anderson wrote:


Use a separate method instead of overriding the existing method. There are assumptions made about the array returned via KVC, and you are breaking those assumptions by reordering an array that EOF thinks it owns.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

--
Robert Walker
email@hidden




_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: EditingContext/Sorting Problem SOLVED
      • From: David Avendasora <email@hidden>
References: 
 >EditingContext/Sorting Problem (From: David Avendasora <email@hidden>)
 >Re: EditingContext/Sorting Problem (From: Ken Anderson <email@hidden>)
 >Re: EditingContext/Sorting Problem SOLVED (From: David Avendasora <email@hidden>)
 >Re: EditingContext/Sorting Problem SOLVED (From: Robert Walker <email@hidden>)

  • Prev by Date: Re: EditingContext/Sorting Problem SOLVED
  • Next by Date: Re: Reading NSData from a file
  • Previous by thread: Re: EditingContext/Sorting Problem SOLVED
  • Next by thread: Re: EditingContext/Sorting Problem SOLVED
  • Index(es):
    • Date
    • Thread