Re: Newby Question
Re: Newby Question
- Subject: Re: Newby Question
- From: Prachi Gauriar <email@hidden>
- Date: Sat, 9 Jul 2005 23:55:16 -0400
On Jul 9, 2005, at 10:57 PM, Jerry Krinock wrote:
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?
No, it doesn't. It's a C array, which means it needs to be handled
using a pointer and either memcpy(), memmove(), or a for loop.
-Prachi
_______________________________________________
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