Users Pricing

forum

home / developersection / forums / in objective-c proper use of application delegate

In Objective-C proper use of Application delegate

Anonymous User 1580 13 Dec 2015

I want to call a web-service to get the users information, and after I want to be able to access this information from anywhere in our application using like this:

MyDelegate *delegate = [[UIApplication sharedApplication] delegate];
user = delegate.u;

Is setting an instance variable as a User object in the app delegate and referencing it from there when needed a poor way of going about it? I typically set it there upon the user's login.


I am a content writter !


1 Answers