ios - How to use one array in different classes? -


i have array. filled in 1 class named "sampledatadao".

what need:

in 2nd class named "mainmenu" need keep code:

- (void)viewdidload { [super viewdidload]; daods = [[sampledatadao alloc] init]; self.ds = daods.populatedatasource; } 

and in third class named "hview" need use array "ds" (nsmutablearray). need use filled 2nd class, return count of elements:

- (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { // return number of rows in section. return ds.count; } 

thanks helping!

why should not have singleton class, , have array member of singleton class.

more info on singleton found here


Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -