Quote:
Originally Posted by JoSoap
I'm trying my best with Objective-C but I have a small problem I just can't figure out. A little help would be appreciated. I have a Global NSMutableArray (why not a singleton - its a long story). In the same class I have two methods which uses the array. The first method has no problems populating and accessing the array. The other method knows about the array because it too has an 'extern NSMutableArray' declaration but it is empty. I haven't released it so what is happening to the contents of my array? 
|
Of course your given info is sparse, results in not knowing what you have.
Did you:
MYClass.m
static NSMutableArray *myArray;
@implementation MyClass
+ (NSMutableArray *)myArray
{
return myArray;
}
@end
This will uncover the file-scoped array using the myArray class method. Now, if you need to have access to tmyArray, use an extern declaration in your MyClass.h.
extern NSMutableArray *relationshipMatch;
Any source file that #imports MyClass.h will know of the existence
of an NSMutableArray *myArray. The references to this
variable will be available during the linker pass.
check if this works for you [MyClass myArray];
HTH