Thanks Stephanie and Mike. NSSelector<Void> works fine, and it makes the code clearer.
Any idea while the language has this Void class? Something to do with void/null/²² Strings? Cheers Michael On 8/5/08 2:55 AM, "Mike Schrag" <[EMAIL PROTECTED]> wrote: > This compiles, at least ... Good to know. > > NSDictionary<String, Void> a = new NSMutableDictionary<String, Void>(); > > ms > > On May 7, 2008, at 1:37 PM, Stephane Guyot wrote: > >> Michael, >> >> did you try the type Class Void ? something like Void.Type ? >> >> HTH, >> Stephane >> >> >> Le 7 mai 08 à 09:35, Michael Scott a écrit : >> >>> NSSelector<Object> works fine. But it is a bit wonky. >>> >>> Perhaps Java should allow 'null' as a type argument. >>> >>> Probably a bit much to ask just to make an old NextStep class more >>> consistent. >>> >>> >>> On 7/5/08 2:11 PM, "Anjo Krank" <[EMAIL PROTECTED]> wrote: >>> >>>> Try to cheat an use <Object>? >>>> >>>> Am 07.05.2008 um 04:12 schrieb Michael Scott: >>>> >>>>> NSSelector has been generified (generifried?) so that the return >>>>> type of the method it calls must be specified as a type parameter. >>>>> >>>>> So, >>>>> NSSelector<String> selector = new >>>>> NSSelector<String>(³testMethod²); >>>>> >>>>> Can be used to call the following method which returns a String >>>>> (regardless on what class the method resides): >>>>> >>>>> public String testMethod() { >>>>> return ³testing, testing, 1, 2, 3 ...²; >>>>> } >>>>> >>>>> But what if the method returns void? >>>>> >>>>> public void testMethod2() { >>>>> // do something fab >>>>> } >>>>> >>>>> What type argument should be used to instantiate NSSelector<T>? >>>>> >>>>> Or have I missed something fundamental? >>>>> >>>>> Cheers >>>>> Michael Scott >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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/krank%40logicunited. >>>>> com >>>>> >>>>> This email sent to [EMAIL PROTECTED] >>>> >>> >>> _______________________________________________ >>> 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/stephane.guyot11%40wan >>> adoo.fr >>> >>> This email sent to [EMAIL PROTECTED] >> >> >> _______________________________________________ >> 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/mschrag%40mdimension.co>> m >> >> This email sent to [EMAIL PROTECTED] > > > > _______________________________________________ > 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/m.scott%40murdoch.edu.au > > This email sent to [EMAIL PROTECTED]
_______________________________________________ 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/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]