More learning questions
More learning questions
- Subject: More learning questions
- From: John Tsombakos <email@hidden>
- Date: Fri, 3 Aug 2001 23:07:14 -0400
Hi,
First, thanks for the help with my last question about NSTableView and
NSStrings. I got my test working. Now, I'm trying to add something, but
I've gotten a bit confused. I know how I would do it in straight C, but
with ObjC and Cocoa, I'm not sure how to set it up. Here's what I have:
A NSTableView subclass in a window; an NSMutableArray that holds the
data for the table, that's fed through a datasource:
MyDataSource.h
NSMutableArray *myArray; is defined
MyDataSource.m
The methods to give the table it needed data
Also, an init method to load up myArray
MyTableView.m/h
Subclass of NSTableView - I override the keyDown event to grab the key
the user hits.
In MyTableView I want to have access to the array. How/where do I
declare/define the array so I can have access to it from MyTableView and
MyDataSource.
I know is C I would have a 'extern int myArray[5];' in a header file
that's included in what ever .c files I needed access to the array, and
in one of the .c files I would have 'int myArray[5];'
Thanks for probably a simple question!
john t.