Please consider these 2 code statements:
id class1 = [[MyClass alloc]init]; //First
MyClass * class2 = [[MyClass alloc]init]; //Second
class1
and class2
are pointers to type id
right? In a header file of objc
, I saw that Class
is just typedef of a struct pointer, and id
is typedef of a struct pointer as well. With those types being declared as pointers to struct, why do I need to include a *
in the second statement of my code?