PDA

View Full Version : How to access NSMutableArray between two classes?




mandude
Dec 12, 2010, 04:05 PM
hey i have an NSMutableArray that contains a list of images. This NSMutableArray is declared in one of my classes, viewCtroller.h




@interface viewController : UIViewController {

NSMutableArray *array;
}
@property (nonatomic, retain) NSMutableArray *array;


ok so nothing too special but in my other class, secondViewController, i'd like that same NSMutableArray *array to be detected by the secondViewContrller.m file. I need to be able to insert or remove object from the array from a different .m file how do i do this? I know i cant write the declaration of the array above the @interface section because i cant have a static NSMutable array all help is appreciated