FROM : Henry McGilton
DATE : Wed Jul 26 20:43:56 2006
On Jul 26, 2006, at 11:37 AM, Brad Bumgarner wrote:
> 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;
Remove the asterisk.
==========================
|
|
|
V
> 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;
> }
> }
Cheers,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:<email_removed> | http://www.trilithon.com
|
===============================+============================
DATE : Wed Jul 26 20:43:56 2006
On Jul 26, 2006, at 11:37 AM, Brad Bumgarner wrote:
> 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;
Remove the asterisk.
==========================
|
|
|
V
> 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;
> }
> }
Cheers,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:<email_removed> | http://www.trilithon.com
|
===============================+============================
| Related mails | Author | Date |
|---|---|---|
| Brad Bumgarner | Jul 26, 20:37 | |
| Henry McGilton | Jul 26, 20:43 | |
| David Emme | Jul 26, 20:46 | |
| Brad Bumgarner | Jul 26, 20:48 | |
| j o a r | Jul 26, 21:14 |






Cocoa mail archive

