Re: NSMutableSet, NSArray and WORepetition - Correct Usage - SOLVED
site_archiver@lists.apple.com Delivered-To: webobjects-dev@lists.apple.com Regards Jonathan :^) From: James Seigel <james.seigel@wrx-ca.com> To: "Jonathan Fleming" <developmentstage@hotmail.com> Subject: Re: NSMutableSet, NSArray and WORepetition - Correct Usage Date: Mon, 31 Jan 2005 08:57:36 -0700 Jonathan. Actually you can just ask the set for .allObjects(). Cheers James. On 31-Jan-05, at 8:49 AM, Jonathan Fleming wrote: this is the code i'm using: Regards Jonathan :^) Ummm... Don't blame me, blame my training... ;^) _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/site_archiver%40lists.... Thanks James, I wasn't looking deep enough in the API, didn't see that method inherited from NSSet You made an NSArray with one element in it: an NSMutableSet. You need to add the pieces from the set into the array. I think I'm doing things on the flip side or I have a fried brain... What is the best way to get a NSMutableSet back into an Array... Why? because I can not use a NSMutableSet in a WORepitition which is calling for a NSArray but more importanly I don't want duplicates in the NSArray. Or should I be filtering this someother way? Suggustions / examples welcome please. Thanks EOFetchSpecification boundFs = new EOFetchSpecification("TbEcmOrder", qualifier, sortOrderings); EOEditingContext myEC = this.session().defaultEditingContext(); queryResultsOrders = myEC.objectsWithFetchSpecification(boundFs); queryResultsOrders_distinct = new NSArray (new NSMutableSet(queryResultsOrders)); System.out.println( "===\r NSArray queryResultsOrders_distinct: \r" + queryResultsOrders_distinct); this is the Error: Exception occurred while handling request: java.lang.IllegalArgumentException: While trying to set the field "tbEcmOrder_distinct" on an object of type Ecm_OrderPaymentStatus we expected a TbEcmOrder but received a com.webobjects.foundation.NSMutableSet with a value of ({values = {...found results... }; this = "<TbEcmOrder 21447f _EOIntegralKeyGlobalID[TbEcmOrder (java.lang.Integer)7]>"; }). This often happens if you forget to use a formatter. I don't understand since I have made this into an NSArray, I belief, but it still seeing a NSMutableSet _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/ james.seigel%40wrx-ca.com This email sent to james.seigel@wrx-ca.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Jonathan Fleming