I have an NSMutabaleArray with few contents, and want to copy the contents to another array in another class, the code:
sandboxcontroller.h:
@interface SandboxViewController : UIViewController
{
NSMutableArray * arrayOfDesc;
}
@property (nonatomic, retain) NSMutableArray * arrayOfDesc;
SandboxContoller.m
@synthesize arrayOfDesc;
[arrayOfDesc addObject:[[CLLocation alloc] initWithLatitude:location.coordinate.latitude longitude:location.coordinate.longitude]];
the class in with i want to copy: NVMapViewController.h
@interface NVMapViewController : UIViewController <MKMapViewDelegate> {
MKMapView *_mapView;
SandboxViewController * sandboxViewController;
NSMutableArray * points;
}
@property (nonatomic, retain) SandboxViewController *sandboxViewController;
NVMapViewController.m
points = [[NSMutableArray alloc] initWithArray:sandboxViewController.arrayOfDesc] ;
When i log the points array, it gives me null. Where is there problem, can anyone suggest me, thanks.
And im not using ARC.
sandboxViewControlleractually set to something when you do the assignment topoints?sandboxViewControlleras well