我的iPhone应用程序出现问题,我得到EXC_BAD_ACCESS,我有一些内存泄漏,但现在已经修复了,所以我不确定是什么时候发生的。我意识到我没有提供很多信息,但我真的不知道发生了什么。
初始屏幕打开,我有许多按钮。点击第一个按钮,该按钮运行以下代码并打开模态视图:
-(IBAction)newWorkoutButton
{
newWorkoutViewController .loadedFromRootViewController = @"YES";
[self presentModalViewController:newWorkoutViewController animated:YES];
}
屏幕冻结,位于以下代码中:
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
#import <CoreLocation/CoreLocation.h>
int main(int argc, char *argv[])
{
Method getDistanceFrom = class_getInstanceMethod([CLLocation class], @selector(getDistanceFrom:));
class_addMethod([CLLocation class], @selector(distanceFromLocation:), method_getImplementation(getDistanceFrom), method_getTypeEncoding(getDistanceFrom));
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil); // ERROR HAPPENING HERE
[pool release];
return retVal;
}
答案 0 :(得分:1)
像Aleks建议你可以尝试找到这样的僵尸:
我觉得这个替代方案更方便:
Profile
Zombies
Zombies http://www.dimzzy.com/blog/wp-content/uploads/2011/02/leaky-zombies-tool.png