i am new to stackoverflow, so please be gentle with me.
I am currently working my way into objective-c and mac os x development and i am currently stuck at the simple task of binding a few objects together in a small project i am working on:
I have an object AppDelegate, created from a NIB file, containing a NSMutableArray. I wanted to access that array in another class derived from NSOpenGLView (created from the NIB File as well) to iterate the objects stored in it.
How can this be achieved in Interface Builder?
Thanks for your help.
UPDATE: Here is part of my AppDelegate code:
.h:
@interface AppDelegate : NSObject <NSApplicationDelegate> {
IBOutlet NSMutableArray *_players;
}
@property (assign) NSMutableArray *_players;
Additionally i have a MyOpenGLView (implementing NSOpenGLView) where i want to access the objects from the _players Array.
Does your
NSOpenGLViewhave an outlet pointing to yourAppDelegate? If not, then you can either make one or use the answer from here.[(YourAppDelegate *)[[UIApplication sharedApplication] delegate] uploadFiles:array](This assumes that
AppDelegateactually refers to the application delegate.)Apple tutorial on interface builder basics (including connecting outlets).