Hi all

Thanks for all the suggestions.

Hope you're having a great time at WWDC! Wish I was there, but I'm working on Parker v3 :-)

The solutions I ended up using was to use rawRowsMatchingKeyAndValue which returns Integers instead of Longs.

Chuck, that's an interesting idea to control the type returned by rawRows, that would be handy to know.

I also implemented NSSets subtractSet to remove the unwanted numbers.

Thanks again, much appreciated!
mich

---------------------------------------
Michelle Parker
Web Objectives Pty Ltd
33 Ridge St
Gordon, NSW , 2072
Australia
Phone: (02) 9499 3166
Fax: (02) 9499 3166
Mobile : 0412 064 123
[EMAIL PROTECTED]
---------------------------------------


On 12/06/2007, at 5:24 AM, Chuck Hill wrote:


On Jun 10, 2007, at 10:34 PM, Michelle Parker wrote:

Hi all

I have a slight problem which I am looking for the most efficient solution:

I am comparing 2 NSArrays containing numbers, with the aim of removing the numbers in one array from the other array.

The first array is obtained by rawRowsForSQL which returns the numbers as Longs. The second array is obtained by valueForKeyPath which returns the numbers as Integers.

In addition to all the other replies, here is another way to handle the type conversion. If the keyPath ends in orderNumber, add a method named something like longOrderNumber:

public Long longOrderNumber() { return new Long(orderNumber ().longValue());
}

Then use ....longOrderNumber instead of ....orderNumber in your keypath.

IIRC, there is also a way to control the type returned by rawRows, but I can't recall what it is.

Chuck



NSArray.removeObjectWithArray or NSSet.subtractSet don't work because the objects are not equal.

The arrays can be very large, ie. 100,000 objects.

What is the best way to handle this?

thanks
mich
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill% 40global-village.net

This email sent to [EMAIL PROTECTED]


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects







 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to