Making Array Pointers Global
Making Array Pointers Global
- Subject: Making Array Pointers Global
- From: "Frederick C. Lee" <email@hidden>
- Date: Thu, 4 Apr 2002 16:47:07 -0800
Greetings:
I'm trying to populate a set of arrays that can be global within a
program/class versus a local within a method. I had thought that if I
declare the array pointer (NSArray *) within the header file or at the
top of the body file, it would essentially be static as are the simple
datatypes like 'int'.
Apparently that is not true:
2002-04-04 16:38:02.430 Converter[1959] Inside LoadArrays.
2002-04-04 16:38:05.172 Converter[1959] Inside setParameters. myNumber=
666
Converter.app has exited due to signal 10 (SIGBUS).
In the above case, 'myNumber' is a simple 'int' and declared at the top
of the object and can be assessed within any method of the object.
But an array (NSArray *) variable appears only to be local within the
defined method. Accessing it anywhere else yields the above 'signal 10'
error.
Question: How can I make an array variable STATIC till I dealloc at the
end?
I've used 'extern' & 'static' keywords without success.
Ric.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.