Can someone explain what (AppDelegate *) in the following snippet means?
(AppDelegate *)[[UIApplication sharedApplication] delegate] iPad]
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.
[[UIApplication sharedApplication] delegate]returns anid. So you can’t access e.g.windowproperty of it (because id object doesn’t have it).(AppDelegate *)statement causes to ‘convert’idtoAppDelegateobject, so you can access its components.It’s like having
NSObject *obj1;andNSString *obj2;– you can’t do-substringToIndex:withobj1…