• 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: NSSelector<T> - a curiosity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSelector<T> - a curiosity


  • Subject: Re: NSSelector<T> - a curiosity
  • From: Michael Scott <email@hidden>
  • Date: Wed, 07 May 2008 15:35:20 +0800
  • Thread-topic: NSSelector<T> - a curiosity

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@hidden> 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      (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: NSSelector<T> - a curiosity
      • From: Stephane Guyot <email@hidden>
    • Re: NSSelector<T> - a curiosity
      • From: Florijan Stamenkovic <email@hidden>
    • Re: NSSelector<T> - a curiosity
      • From: Ricardo Parada <email@hidden>
References: 
 >Re: NSSelector<T> - a curiosity (From: Anjo Krank <email@hidden>)

  • Prev by Date: Getting WebObjects Javadoc to appear in eclipse
  • Next by Date: Re: WO Tutorials
  • Previous by thread: Re: NSSelector<T> - a curiosity
  • Next by thread: Re: NSSelector<T> - a curiosity
  • Index(es):
    • Date
    • Thread