error: can not use an object as parameter to a method.Which means:
Objects, i.e. instances of classes, can only given to a function via a pointer (id). This is because in contrast to structs (e.g. CGRect) and basic data types (int, float, etc.), classes may have custom constructors and deconstructors which the compiler is not able to call for you when a copy shall be given to the function. So basically:
- (NSString) sayYeah { NSLog(@"YEAH"); }; // won't work- (NSString*) sayMaan { NSLog(@"MAAN"); }; // will work, notice the *
Keine Kommentare:
Kommentar veröffentlichen