I don't know if I'm doing this properly. I'm working on a large application in which a user must log in and and interact with a variety of functionality and data. There are many view controllers that need to have access to this user object.
The following snippet is the moment when the user logs in and now I have a user object to use across my app. Just in this case I'm using dummy data.
User *user = [User new];
[user setupTempOfflineData];
self.newViewController.user = user;
[self containerAddChildViewController:self.newViewController];
In the newViewController is the property:
@property (nonatomic, strong) User *user;
Now NewViewController may have many children and those children have view controllers of their own. All of them given a strong reference to the user. Additional information such as a list of registered groups or content that the user had created remains as well. And sometimes I'll either access downloaded information via the user object, or just store and share references to the arrays/data themselves.
Something in my head is telling me I should be using a singleton or some other design pattern I'm just not familiar with. Thus bringing me here to ask the question:
Am I doing this right?
Edit: Informative link on KVO