2011-11-25 4 views
0

私は別のクラスをメソッドとして呼びますが、私はこのエラーを受け取ります。私はそれを検索するが、私はこれを解決するための何も見つかりませんでした。助けてください。別のクラスを呼び出すときに 'NSException'のインスタンスをスローした後にTerminateが呼び出されます

コード:

adres = [adres stringByAppendingString:[NSString stringWithFormat:@"%@", textArama.text]]; 

    BaseHttpPost *m_HttpDownloadSearch = [[[self class] alloc] init]; 
    [m_HttpDownloadSearch HttpPost:adres data:@""]; 

エラーは次のとおりです。

2011-11-26 00:46:10.386 Sarki Sözleri[1520:207] -[Sarki_So_zleriViewController HttpPost:data:]: unrecognized selector sent to instance 0x4b6ad30 
2011-11-26 00:46:10.388 Sarki Sözleri[1520:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Sarki_So_zleriViewController HttpPost:data:]: unrecognized selector sent to instance 0x4b6ad30' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x00e315a9 __exceptionPreprocess + 185 
    1 libobjc.A.dylib      0x00f85313 objc_exception_throw + 44 
    2 CoreFoundation      0x00e330bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 
    3 CoreFoundation      0x00da2966 ___forwarding___ + 966 
    4 CoreFoundation      0x00da2522 _CF_forwarding_prep_0 + 50 
    5 Sarki SoÃàzleri      0x0000250e -[Sarki_So_zleriViewController btnAra_click:] + 382 
    6 UIKit        0x000834fd -[UIApplication sendAction:to:from:forEvent:] + 119 
    7 UIKit        0x00113799 -[UIControl sendAction:to:forEvent:] + 67 
    8 UIKit        0x00115c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527 
    9 UIKit        0x001147d8 -[UIControl touchesEnded:withEvent:] + 458 
    10 UIKit        0x000a7ded -[UIWindow _sendTouchesForEvent:] + 567 
    11 UIKit        0x00088c37 -[UIApplication sendEvent:] + 447 
    12 UIKit        0x0008df2e _UIApplicationHandleEvent + 7576 
    13 GraphicsServices     0x0130a992 PurpleEventCallback + 1550 
    14 CoreFoundation      0x00e12944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 
    15 CoreFoundation      0x00d72cf7 __CFRunLoopDoSource1 + 215 
    16 CoreFoundation      0x00d6ff83 __CFRunLoopRun + 979 
    17 CoreFoundation      0x00d6f840 CFRunLoopRunSpecific + 208 
    18 CoreFoundation      0x00d6f761 CFRunLoopRunInMode + 97 
    19 GraphicsServices     0x013091c4 GSEventRunModal + 217 
    20 GraphicsServices     0x01309289 GSEventRun + 115 
    21 UIKit        0x00091c93 UIApplicationMain + 1160 
    22 Sarki SoÃàzleri      0x00001d09 main + 121 
    23 Sarki SoÃàzleri      0x00001c85 start + 53 
) 
terminate called after throwing an instance of 'NSException' 

私を助けてください!

+0

まず、ゾンビオブジェクト(オーバーレリーズされたオブジェクト)がある場合、NSZombieEnabledとInstrumentsを介してチェックします。これらはメモリを破壊し、あなたのような例外を作成する傾向があります。また、アプリが複数のスレッドでデータ構造を使用しているかどうかを確認してください(ウェブダウンロードコールバックなど)。これにより、メモリが破損する可能性があります。 –

+0

私はiPhoneを初めて使っているので、BaseHttpPostという名前のクラスがあり、私はちょうどButonのクリックアプリケーションを使って他の何かをしたくありません。 –

+0

アプリケーションを数回以上実行します。同じクラスで 'HttpPost:data:' – aopsfan

答えて

1

[[[self class] alloc] init]を使用しないでください。おそらく[BaseHttpPost alloc] init]が必要です。

0

ので、なぜあなたは割り当て、現在のクラスのオブジェクトを初期化して、それから、このメソッドを呼び出している..クラスをBaseHttpPostに属し-(void)HttpPost:adres data:方法Sarki_So_zleriViewController多分のViewControllerたからウルBaseHttpPostはメソッドを持っていながら、このメソッドを呼び出す

関連する問題