Ios 我应该如何释放一个嵌入的核心基础对象?
代码如下:Ios 我应该如何释放一个嵌入的核心基础对象?,ios,objective-c,memory-management,xcode4.6,Ios,Objective C,Memory Management,Xcode4.6,代码如下: - (void) drawToday { int x; int y; int day; CFGregorianDate today = CFAbsoluteTimeGetGregorianDate(currentTime, CFTimeZoneCopyDefault()); if(today.month == currentMonthDate.month && today.year==currentMonthDate.year) { int swidt
- (void) drawToday {
int x;
int y;
int day;
CFGregorianDate today = CFAbsoluteTimeGetGregorianDate(currentTime, CFTimeZoneCopyDefault());
if(today.month == currentMonthDate.month && today.year==currentMonthDate.year) {
int swidth = self.frame.size.width / 7;
int weekday=[self getMonthWeekday:currentMonthDate];
day = today.day + weekday - 2;
x = day % 7;
y = day / 7;
它在抱怨:CFTimeZoneCopyDefault()说
调用函数“CFTimeZONECOPYDEFAULT”返回一个核心基础对象,具有+1保留计数<强>和<强/>对象泄漏:在该执行路径中未引用分配对象,保留计数为+1</p> 我应该如何解决这个问题(即释放嵌入的对象)?
通常:CFTimeZoneRef tzref = CFTimeZoneCopySystem();
CFGregorianDate today = CFAbsoluteTimeGetGregorianDate(currentTime, tzref);
CFRelease( tzref);
有时这只是其中的一天:-)