Re: Newby Question
Re: Newby Question
- Subject: Re: Newby Question
- From: Jerry Krinock <email@hidden>
- Date: Sat, 09 Jul 2005 19:57:31 -0700
on 05/07/09 17:45, R T at email@hidden wrote:
> I'm using an array in a class and I'm not sure how to
> write the get and set methods...can anyone correct
> these lines.
You may have read this article or one of its derivatives:
http://www.stepwise.com/Articles/Technical/2001-03-11.01.html
emphasizing the section "Always use Accessor Methods" (get and set).
But that section discusses accessing Objective-C *object* instance variables
(such as the NSNumber it uses as an example). Your instance variable is not
an object; it is a plain old C array. In my opinion, therefore, your code
is fine as far as it goes. It works, doesn't it?
You should be aware, though, that you rarely see plain old C arrays in
Objective-C code. We instead use NSArray or NSMutableArray, because they
are, to put it mildly, way more flexible.
_______________________________________________
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