When I create an instance of a class called, say, Sprite, I do something like:
Sprite *mySprite = [[Sprite alloc]init];
But why when creati
The * denotes a pointer. CGSize
is declared as a struct
and Sprite
is a class, and in Objective-C all classes are referenced by a pointer.
You can find additional information in the Programming with Objective-C documentation. The relevant sections are Use Pointers to Keep Track of Objects and Methods Can Return Values.