Accessors for 2D Arrays?
Accessors for 2D Arrays?
- Subject: Accessors for 2D Arrays?
- From: "jz" <email@hidden>
- Date: Tue, 1 Nov 2005 21:42:42 -0500 (EST)
#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