Re: Accessors for 2D Arrays?
Re: Accessors for 2D Arrays?
- Subject: Re: Accessors for 2D Arrays?
- From: Ian was here <email@hidden>
- Date: Tue, 1 Nov 2005 20:09:57 -0800 (PST)
I've never seen methods declared in this manner
before:
- (int)gM[4][4];
- (void)setGM[4][4]: (int)aGM[4][4];
What exactly are you trying to accomplish?
--- jz <email@hidden> wrote:
>
> #import <Cocoa/Cocoa.h>
> int gM[4][4] = {{0, 0, 0, 0,}, {0, 0, 0, 0,}, {0, 0,
> 0, 0,}, {0, 0, 0, 0,}};
>
> @interface MyController: NSObject {
> - (int)gM[4][4];
> - (void)setGM[4][4]: (int)aGM[4][4];
> }
>
> @implementation MyController
>
> - (int)gM[4][4]
> {
> return gM[4][4];
> }
>
> - (void)setGM[4][4]:(int)aGM[4][4]
> {
> gM[4][4] = aGM[4][4];
> }
> The above accessors don't work.
> How to write accessors for a global array to replace
> one item and retain value of other items?
>
> I also tried: [gM[4][4] replaceObjectAtIndex: 1,1
> withObject: [NSNumber numberWithInt: 99] ]; but the
> compiler gives me an error "invalid integer gM"
>
> Thanks in advance."
>
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
>
>
> _______________________________________________
> 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
>
__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs
_______________________________________________
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