I can’t understand what this code does:
AppDelegate *appDelegate =
[[UIApplication sharedApplication] delegate];
can somebody explain it to me please??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are getting a pointer to the Application Delegate.
returns you a pointer to your application instance (singleton instance, only one instance of that object is permitted, and it’s returned by the “sharedApplication” method).
Then, “delegate” returns the delegate of this UIApplication instance, that usually is implemented in the AppDelegate.m and AppDelegate.h files of your application and it’s of AppDelegate Class.