• 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
More learning questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: More learning questions
      • From: "David P. Henderson" <email@hidden>
  • Prev by Date: Re: "help" URLs
  • Next by Date: Thanks all
  • Previous by thread: Very weird windowWillClose behavior
  • Next by thread: Re: More learning questions
  • Index(es):
    • Date
    • Thread