How do I set an array in one class with another array in another class
- by Stef
I've populated and array with data like this in one class...
PowerClass.h
NSMutableArray pickerArray;
@property (nonatomic, retain) NSMutableArray pickerArray;
-
PowerClass.m
@synthesize pickerArray;
@implementation
NSMutableArray *array = [[NSArray alloc] initWithObjects:@"stef", @"steve", @"baddamans", @"jonny", nil];
pickerArray = [NSMutableArray arrayWithArray:array];
And I'm trying to set the Array in another class
WeekClass.h
PowerClass *powerClass;
NSMutableArray *pickerData;
@property (nonatomic, retain) NSMutableArray pickerData;
@property (nonatomic, retain) PowerClass *powerClass;
WeekClass.m
@implementation
pickerData = [NSMutableArray arrayWithArray:powerClass.pickerArray];
I have no errors or warnings. It just crashes. The NSLog says that the powerClass.pickerArray is NULL.
Please help point me in the right direction.