Re: Date pickers
Re: Date pickers
- Subject: Re: Date pickers
- From: Deivy Petrescu <email@hidden>
- Date: Fri, 26 Feb 2010 19:51:36 -0500
On 26/02/2010, at 19:24 , Craig Williams wrote:
>> Rob,
>> You sent me the script above which I have used to get some dates.
>> Researching it further, in Objective-C, every time you alloc() something you have to dealloc()
>> So I used in my code
>>
>> ---
>> current application's class "NSDateFormatter"'s dealloc()
>> ---
>>
>> It compiles and run with no problem.
>> So, I am not sure, but being cautious apparently does not cause any problem.
>>
>> Deivy Petrescu
>> email@hidden
>
> Hey Rob,
>
> You should never call dealloc except when calling [super dealloc] in a dealloc method.
> Instead you will call release on the object that needs freeing.
>
> What you are doing above is not releasing the object that was created, which was myFormatter,
> but instead, you are calling the dealloc() method on the class NSDateFormatter. I am not sure what that does
> but you should not do it.
>
> The correct way to release myFormatter is:
> myFormatter's release()
>
> Regards,
>
> Craig
Craig, it was I that did it.
I will certainly use your suggestion from now on, however, what is being deallocated is the **current app class ..."
Since I run it the app without any problem I might not have done anything that bad.
But, right now, I now I do not need to release since as per Shane's last email we do use GC.
Deivy Petrescu
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden