【发布时间】:2013-02-17 04:40:12
【问题描述】:
我有一个来自 UIDeviceRGBColor 的泄漏。负责的框架是 +[UIColor allocWithZone:]。我没有使用 ARC。
泄漏来自以下方法。
- (void) lAction
{
MKCoordinateRegion mapRegion;
mapRegion.center = mapView.userLocation.coordinate;
mapRegion.span.latitudeDelta = 0.05;
mapRegion.span.longitudeDelta = 0.05;
[mapView setRegion:mapRegion animated: YES];
SettingsViewController *settingsViewController = [[SettingsViewController alloc]
initWithNibName:@"SettingsViewController" bundle:nil];
泄漏来自下一行:
[self presentModalViewController: settingsViewController animated:YES];
然后这个方法就这样结束了:
self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:40.0/255.0
green:43.0/255.0 blue:46.0/255.0 alpha:1.0];
}
有人知道如何解决这个问题吗?谢谢大家!
【问题讨论】:
-
如果您在发布问题之间只需要等待 8 分钟,那么您应该尝试在发布之前更好地自己找到答案。
-
非常感谢 - 试图深入记忆管理的星云。经历了大约一千次,正在从专家那里收集更多知识。
-
您可以从我的帖子中看到我没有使用 ARC。你会建议我尝试转换我的项目吗?
-
@Brandon 你找到解决办法了吗?
标签: iphone ios objective-c xcode memory-leaks