2010-12-06 3 views
0

Ich möchte dieses Array in jedem Unter zugreifen können, in meinem secondviewcontroller waren füge ich diese Codierung es über jeden UnterGlobale Mutable Array

NSMutableArray *YoutubeArray; 
    YoutubeArray = [[NSMutableArray alloc] init]; 

Antwort

1

Erstellen Sie eine Eigenschaft in der Schnittstelle zugänglich zu machen.

Schnittstelle (.h-Datei):

NSMutableArray *_youtubeArray; 

@property(nonatomic,retain)NSMutableArray * youtubeArray; 

Implementierung (.m Datei):

@synthesize youtubeArray=_youtubeArray; 


//in viewDidLoad/initwith... 
self.youtubeArray = [[NSMutableArray alloc] init]; 

Alternativ und Verwendung für mehr Raum ein singleton structure