A perhaps basic question regarding a singleton class which I want to have as a "dataController"
I have based most of the singleton implementation on the banans thread: Using a singleton to create an array accessible by multiple views
I am wondering about functions in the singleton class. Before I made the dataController a singelton i hade a function to add a banana to the masterBananaList.
How do I use this function instead of manipulating the array list directly in the viewController that I am in.
I.e how do I use this: (I get warning: dataController hides instance variables)
DataControllerSingleton *dataController= [DataControllerSingleton singleDataController];
[dataController addBananaToList:banana];
Instead of:
DataControllerSingleton *dataController= [DataControllerSingleton singleDataController];
[dataController.masterBananaList addObject:care];
Do i use local or global functions in an Singleton and if I use global how do i use self.masterBananaList which only works for local methods.