Method with +
Method with +
- Subject: Method with +
- From: Lorenzo <email@hidden>
- Date: Sat, 20 May 2006 00:25:33 +0200
Hi,
before I init my class, I need to get an array of values so, in that class
I created a + method which calloc an array and returns it.
Who is the responsible to free the array? The caller or the class?
And, when I call GetParametersList, do I cause a lack of memory?
I mean, should I release something later?
Is it correct the use I do?
BOOL *par = [MyClass GetParametersList];
// in the class MyClass
+ (BOOL*)GetParametersList
{
BOOL *parList = calloc(kTotTimeParam, sizeof(BOOL));
int i;
for(i = 0; i < kTotTimeParam; i++){
parList[i] = (i >= kTimeGenPosX && i <= kTimeGenVolu);
}
return parList;
}
Best Regards
--
Lorenzo
email: 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:
This email sent to email@hidden