How do I add a NSMatrix to a NSMutableArray
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