Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I add a NSMatrix to a NSMutableArray





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:
http://lists.apple.com/mailman/options/cocoa-dev/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:
http://lists.apple.com/mailman/options/cocoa-dev/ 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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.