Re: NSArray parameter and warning
Re: NSArray parameter and warning
- Subject: Re: NSArray parameter and warning
- From: yizi wang <email@hidden>
- Date: Mon, 04 Feb 2013 16:37:27 -0700
Thanks a lot Paul and speery for the help.
The eo classes did generated by MyModel.eogen
so it worked very well when I just say return User.fetchAllUsers(ec());
On Feb 4, 2013, at 3:47 PM, Paul Hoadley wrote: I got warning for the following method:
public NSArray<User> users() { return EOUtilities.objectsForEntityNamed(ec(), "User"); }
It said that "Type safety: The _expression_ of type NSArray needs unchecked conversion to conform to NSArray<User>"
How to provide 'unchecked conversion'?, What's the recommended way to fix this?
A suggestion has been provided, but here's an alternative. If you're using the standard WOLips/Wonder templates to generate your EO classes, you can re-write that as:
public NSArray<User> users() { return User.fetchAllUsers(ec()); }
That method is properly genericised, and so doesn't need casting or warning suppression.
|
_______________________________________________
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