Re: How do I add a NSMatrix to a NSMutableArray
Re: How do I add a NSMatrix to a NSMutableArray
- Subject: Re: How do I add a NSMatrix to a NSMutableArray
- From: Graham Cox <email@hidden>
- Date: Mon, 1 Nov 2004 00:09:36 +1100
There isn't a method that sets the selection from an array. You'll have
to iterate through the cells in the array and then select them one at a
time.
This might tell you something ;-)
I suspect that you're trying to manipulate the selection in a way that
it's not designed for. The methods of NSMatrix include many different
ways of manipulating the selection, but this isn't one of them. What
are you trying to do? It always helps to work with the framework rather
than against it.
--Graham
On 31 Oct 2004, at 11:07 pm, Peter Karlsson wrote:
Hi!
And thanks for you help. One more question if you have the time. I
want to
set the matrix from the mutablearray as well. How do I do that?
Peter
Ursprungligt meddelande
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
_______________________________________________
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