• 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
How do I add a NSMatrix to a NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I add a NSMatrix to a NSMutableArray


  • Subject: How do I add a NSMatrix to a NSMutableArray
  • From: Graham Cox <email@hidden>
  • Date: Sun, 31 Oct 2004 23:04:42 +1100



Try:

NSMutableArray* myArray = [[myMatrix selectedCells] mutableCopy ];


Now, your code:

[myMutableArray addObject:

will add one object to an array...

[NSString stringWithFormat: @"%d"

...which will be a string object...

@"%d",
[myMatrixOutlet selectedCells]]];

...errr, this doesn't do anything sensible. It's trying to turn an array into an integer, then format a string with it. You can't do that.


--Graham





On 31 Oct 2004, at 9:52 pm, Peter Karlsson wrote:

A little correction. I mean, how do I add the values of a matrix to a
mutablearray. Sorry for that.

Peter

Ursprungligt meddelande

Dear list!

How do I add a NSMatrix to a NSMutableArray? I have tried this:

[myMutableArray addObject:[NSString stringWithFormat: @"%d",
[myMatrixOutlet selectedCells]]];

But I'm a little unsure if it's the right way.

I also want to read it back from the array into the matrix.

Best regards Peter

_______________________________________________
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


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden

This email sent to email@hidden


_______________________________________________
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
  • Prev by Date: RE: How do I add a NSMatrix to a NSMutableArray
  • Next by Date: Re: Thread Cancelation
  • Previous by thread: RE: How do I add a NSMatrix to a NSMutableArray
  • Next by thread: Re: How do I add a NSMatrix to a NSMutableArray
  • Index(es):
    • Date
    • Thread