Newbie Question: Multidimensional NSMutableArray Creation
Newbie Question: Multidimensional NSMutableArray Creation
- Subject: Newbie Question: Multidimensional NSMutableArray Creation
- From: William Jamieson <email@hidden>
- Date: Mon, 14 May 2001 19:35:19 +1000
Hello All,
I am new to java and java-cocoa programming and I have been trying to figure
out a workaround to create a multidimensional NSMutableArray.
I have a NSTableView (with 4 columns and a variable number of rows) in a
window with a custom class as its DataSource. What I really want to do is
have an Parent NSMutableArray that is an array of Rows (also
NSMutableArrays). Thus creating a (workaround) multidimensional Array
(similar to a String[][] in java).
When I need to access cell data (eg. Row 3, Column 2) from the Array System
I can set a variable to the row 3 object (an NSMutableArray). I can then get
the 2nd object in the Row which represents the 2nd Column Data for that row.
If I need to replace a cell's data (eg. Row 3, Column 2) from the Array
System I can set a variable (eg. 'myExtractedRow') to the row 3 object (an
NSMutableArray). I can then replace the 2nd object in the Row which
represents the 2nd Column Data for that row. Following this can replace the
3rd object in the parent array with the new 'myExtractedRow' Array'.
Qusetions:
1 . How do I create an NSMutableArray of NSMutableArrays (if this is even
possible)?
2. How do I set up the parent NSMutableArray and and set up the methods to
add and remove rows (also NSMutableArray's) from the parent array?
3. Is there a better/easier way to do this other than what I am proposing?
I would love to hear from anyone who uses multidimensional arrays to store
data in.
Any help would be greatly appreciated!!!!!!
Thanks for you time.
William Jamieson
Systems Developer
Smart Works Systems
_____________________________________________________________
113 Ferrars St Phone: 03) 9696 6851
Southbank Fax: 03) 9690 0092
VIC 3006 Mobile: 0412 715 735
Australia Email: email@hidden
WWW:
http://www.smartworks.com.au/
_____________________________________________________________