I'm trying to pass an NSArray containing strings for use in another class than the one in which it is generated. Therefore I have made it a property as following:
loginController.h
#import <Cocoa/Cocoa.h>
@interface loginController : NSObject {
NSArray *myArray;
}
@property (nonatomic, retain) NSArray * myArray;
@end
loginController.m
#import "loginController.h"
@implementation loginController
@synthesize myArray;
@end
The question is how the interface and implementation files of the class in which I want to access myArray should look like. At this moment the interface file looks as following:
#import <Cocoa/Cocoa.h>
#import "loginController.h"
@interface viewController : NSObject {
NSArray* myArray;
}
@property (nonatomic,retain) NSArray* myArray;
@end
I'm not sure if this is correct and how to implementation should look if I want to use myArray in it. Can somebody help?