I have this code from a textbook tutorial:
void drawShapes (id shapes[], int count) { int i; for (i = 0; i < count; i++) { id shape = shapes[i]; [shape draw]; } }
And Xcode tells me about the error: "Automatic reference counting error: should explicitly describe the alleged ownership of the parameter of the array of objects."
What am I doing wrong?
If you want to pass an automatically allocated array, change the function declaration to:
void drawShapes (id __autoreleasing shapes[], int count)
and that should take care of your mistake!
.ARC Apple iOS5.0. iOS ARC.ARC , NSArray, complier, ARC.
. .
1. :
, ARC C [].
2. , ARC
iOS, iOS, " " .
Mac OS ( iOS), , "Building Settings", " ", "NO".
[ ]; , . , [ ] []. , .