• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Method with +
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Method with +
      • From: Eric Long <email@hidden>
    • Re: Method with +
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: Binding to Accessors of Application Delegate
  • Next by Date: Referring to Other Classes
  • Previous by thread: Re: KVO: programmatically created custom views not getting initial value notifications
  • Next by thread: Re: Method with +
  • Index(es):
    • Date
    • Thread