Re: Method not seeing array as array
Re: Method not seeing array as array
- Subject: Re: Method not seeing array as array
- From: Ricky Sharp <email@hidden>
- Date: Wed, 02 Feb 2005 14:47:42 -0600
On Wednesday, February 02, 2005, at 01:32PM, Michael Swan <email@hidden> wrote:
>@interface AppController : NSObject
>{
> IBOutlet NSMatrix *channelDisplay;
> IBOutlet NSMatrix *channelMatrix;
> IBOutlet NSTextField *grandMaster;
> NSArray *channelArray;
> MSChannel *channel1;
> MSChannel *channel2;
> MSChannel *channel3;
[rest snipped]
This is outside of the problem you're experiencing, but you may want to simplify your code and use indexed accessors to maintain the array of channels.
e.g. methods following a pattern like this (assuming the ivar is named 'channels'):
- (unsigned int)countOfChannels;
- (id)objectInChannelsAtIndex:(unsigned int)index;
- (void)insertObject:(MSChannel *)newMSChannel inChannelsAtIndex:(unsigned int)index;
- (void)removeObjectFromChannelsAtIndex:(unsigned int)index;
- (void)replaceObjectInChannelsAtIndex:(unsigned int)index withObject:(MSChannel *)newMSChannel;
If you have Accessorizer, you can auto-generate all this code (also including the implmentations).
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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