Accessor method for array of floats
Accessor method for array of floats
- Subject: Accessor method for array of floats
- From: Johan Kool <email@hidden>
- Date: Sat, 19 Jul 2003 21:52:59 +0200
Hello,
I've been struggling with some accessor methods lately. I know this one
for
floats, ints and other C variables:
-(void)setParameter:(float)inValue {
parameter = inValue;
}
-(float)parameter {
return parameter:
}
and this one for Cocoa objects:
-(void)setObject:newObject {
[newObject retain];
[object release];
object=newObject;
}
or the one with autorelease.
But how do I create an accessor for my array of floats? I want to store
that entire
array of floats in a variable of my model class, and have the entire
array returned
when I use the appropiate accessor method. But the problem is that I
don't know
how to allocate the memory for the variable in my model class so it is
big enough
to hold the entire content of my array. What should I do?
Thank you in advance!
Johan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.