When i try to call a NSMutableArray from a diffirent class its empty why?
CLASS A
.h
@interface Dashboard : UIViewController {
NSMutableArray *tablearrayCREDITS;
}
@property(nonatomic,retain)NSMutableArray *tablearrayCREDITS;
.m
@synthesize tablearrayCREDITS;
And im filling it with data from a JSON array.This all works as it should be..
CLASS B
.h
#import "Dashboard.h"
@interface CreditsAndDebits : UIViewController {
//nothing needed here..
}
.m
@implementation CreditsAndDebits
@synthesize selectedIndexPath;
NSMutableArray *thearray;
- (void)viewDidLoad {
Dashboard *db = [[Dashboard alloc]init];
thearray = db.tablearrayCREDITS;
}
//When i debug it and set a breakpoint on where i allocate the Dashboard.. the tablearrayCREDITS says objects 0??, i dont get it? why is it going empty when im calling it?
1 Answer