(no subject)
(no subject)
- Subject: (no subject)
- From: Brad Bumgarner <email@hidden>
- Date: Wed, 26 Jul 2006 12:37:32 -0600
In the following code I get a warning at the line indicated with the
arrow ("--->"). The warning is:
"warning: assignment from incompatible pointer type." I thought
using an "id" declaration would avoid this kind of thing.
-(NSArray *)shiftObjectsInArray: (NSMutableArray *)anArray {
int x;
id *roller;
if ([anArray count] > 0) {
---> roller = [anArray lastObject];
for (x = [anArray count]; x = 1; x--) {
[anArray replaceObjectAtIndex: x withObject: [anArray
objectAtIndex: x-1]];
}
[anArray replaceObjectAtIndex: 0 withObject: roller];
return anArray;
} else {
return nil;
}
}
Basically, what I am trying to accomplish is a "shift and roll" of
the objects in "anArray." I want to shift every object to the next
higher position and "roll" the last object to the first position in
the array.
Brad Bumgarner, CTA
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden