Array types cannot be a type variable or a parameterised type. You will need to suppress the warning if you want to use the NSArray(E[]) constructor

On 22/11/2007, at 4:17 PM, Gaastra Dennis - WO Lists wrote:

Dear List,

We like to create a nested array the following way:

NSArray<String> row1 = new NSArray<String>(new String[] {"Jim","Pattison"}); NSArray<String> row2 = new NSArray<String>(new String[] {"Tony","Lo"}); NSArray<String> row2 = new NSArray<String>(new String[] {"Keezo","Shimano"}); NSArray<NSArray<String>> rows = new NSArray<NSArray<String>>(new NSArray[]{row1,row2,row3});

yielding compiler warning for the 4th line:

... warning: [unchecked] unchecked conversion
found   : com.webobjects.foundation.NSArray[]
required: com.webobjects.foundation.NSArray<java.lang.String>[]
NSArray<NSArray<String>> rows = new NSArray<NSArray<String>>(new NSArray[]{row1,row2,row3});

How to fix this by keeping the code structure almost the same - without having to use arrayByAddingObject or (Mut) addObject?
.. and no suppression of warnings...
We tried changing NSArray[] to NSArray<String>[], but without success.

With Kind Regards,

Dennis Gaastra, M.B.A.[sfu.ca], B.Sc.[ubc.ca]
Chief Technology Officer,


_______________________________________________
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/qdolan%40gmail.com

This email sent to [EMAIL PROTECTED]



--
Seeya...Q

Quinton Dolan - [EMAIL PROTECTED]
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806



 _______________________________________________
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