How do I set an Array in one class with another array in another class in Objective-C
- by Stef
Hi Guys,
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... I don't know why this is...
Please help point me in the right direction...
Thanx guys
Stef :-)