2
私のiPhoneアプリケーションに問題がありますが、EXC_BAD_ACCESSを取得しています。メモリリークがありましたが、現在修正されているので、何が起こっているのか分かりません。私は多くの情報を提供していないことを認識していますが、何が起きているのかは分かりません。モーダルビューを開くときにEXC_BAD_ACCESS
多くのボタンがある初期画面が開きます。次のコードを実行し、モーダルビューを開き、最初のボタン、をタップ:
-(IBAction)newWorkoutButton
{
newWorkoutViewController .loadedFromRootViewController = @"YES";
[self presentModalViewController:newWorkoutViewController animated:YES];
}
画面がフリーズし、以下のコードである:ALEKSはあなたが試すことができます示唆したと同様
#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;
}
「ゾンビ」モードを有効にして、もう一度プログラムを実行する - あなたは、エラーが発生した場所を正確に何を/が表示されます。このモードを有効にする方法については、http://stackoverflow.com/questions/2190227/how-do-i-set-nszombieenabled-in-xcode-4を参照してください。 –
あなたは 'class_getInstanceMethod' /' class_addMethod'で何を達成しようとしていますか? –
あなたはいくつかの自動リリースされたオブジェクトをリリースしているかもしれません..あなたがクラッシュログを与えることができるなら、より良いでしょう。 – Ali3n