• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Accessors for 2D Arrays?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Accessors for 2D Arrays?
      • From: Greg Herlihy <email@hidden>
    • Re: Accessors for 2D Arrays?
      • From: Ian was here <email@hidden>
  • Prev by Date: makeing a copy of an object...
  • Next by Date: Re: Accessors for 2D Arrays?
  • Previous by thread: Re: makeing a copy of an object...
  • Next by thread: Re: Accessors for 2D Arrays?
  • Index(es):
    • Date
    • Thread