Re: Nested NSArray of Strings - Generics - WO5.4
Re: Nested NSArray of Strings - Generics - WO5.4
- Subject: Re: Nested NSArray of Strings - Generics - WO5.4
- From: "Daniele Corti" <email@hidden>
- Date: Thu, 22 Nov 2007 09:30:50 +0100
2007/11/22, Gaastra Dennis - WO Lists <email@hidden>:
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});
Did you try:
NSArray<NSArray> rows =
new NSArray<NSArray>(
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,
Chief Technology Officer,
_______________________________________________
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
--
Daniele Corti
AIM: S0CR4TE5
Messenger:
email@hidden--
Computers are like air conditioners -- they stop working properly if you open
WINDOWS
--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young
_______________________________________________
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