I have just been looking at some old code and it got me thinking about which of these to use, both seem to work without complaint. I was just curious when I spotted the difference.
THIS:
id <UIApplicationDelegate> appDelegate = [[UIApplication sharedApplication] delegate];
OR
id appDelegate = [[UIApplication sharedApplication] delegate];
i guess it depends on what you are asking to appDelegate
i mean, if you are going use the property “window” which is defined in UIApplicationDelegate protocol:
then you should use :
but if you try:
you’ll get an error…