I m trying to remove memory leaks. Below is my code.
currentTime = CFAbsoluteTimeGetCurrent();
CFTimeZoneRef currentTimeZone = CFTimeZoneCopyDefault();
todaysDate = CFAbsoluteTimeGetGregorianDate(currentTime, currentTimeZone);
[currentTimeZone release];
currentTimeZone = nil;
Warning:::/myclass.m:87: warning: invalid receiver type ‘CFTimeZoneRef’
how to release memory for typedef const struct?
With
CFxxxCopyxxxyou should useCFRelease.Edit:
There are CoreFoundation classes that are Toll-Free bridged and your original statement was not leaking but just needed a cast. I would still recommend using
CFReleasesince you were working directly with CoreFoundation.