nsinvocation

    0熱度

    1回答

    在我的Objective-C的項目,我有一個奇怪的,可以說,功能我有一個類,像這樣: #import <Foundation/Foundation.h> @interface Convert /* : NSObject */ // <--- is that necessary? +(int) toInt:(id) obj; @end @implementation Convert

    19熱度

    2回答

    我無法讓forwardInvocation正常工作。出於某種原因,Objective-C運行時完全忽略了我的forwardInvocation:方法並引發了無法識別的選擇器異常。 我的測試代碼如下: @interface InvocationTest : NSObject { } + (void) runTest; @end @interface FullClass: NSObj

    1熱度

    1回答

    在這種方法的蘋果documentation,它說,在最後的以下內容: 特別注意事項 這種方法,自Mac OS X v10.0開始提供,在Mac OS X v10.5中公開。僅支持輸入運行應用程序的運行時風格的編碼字符串。在公開這種方法時,沒有承諾二進制兼容地支持任何「舊式」編碼字符串發生這種變化後。 這是你的責任類型的字符串它們無論是從當前的運行數據或應用程序正在運行的運行匹配字符串類型使用的樣式

    0熱度

    2回答

    我在背景線程上調用選擇器, 選擇器的周圍有NSAutorelasePool。 我想我傳遞給選擇器的參數導致了問題。 我該如何處理它? SEL theSelector; NSMethodSignature *aSignature; NSInvocation *anInvocation; theSelector = @selector(changeColor:forCo

    2熱度

    1回答

    您好我有以下代碼 NSString *analyticsStr = [[NSString alloc] initWithString:[self constructXMLMessage:TagObj]]; NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self

    0熱度

    1回答

    對於iPhone模擬器iOS4.0 +,NSInvocation不能很好地處理異常。我碰到一個workaround使用objc_msgSend。當我嘗試將下面的調用作爲objc_msgSend(target_,[調用選擇器])並在createResponseFromInvocation()下注釋掉[調用調用]時掛起。我嘗試了不同的方式調用obj_msgSend,並沒有奏效。 - (NSInvoc

    2熱度

    2回答

    我想創建NSInvocationOperation選擇這樣,它應該調用對象的方法使用參數 - (void) getImages: (NSRange) bounds { NSOperationQueue *queue = [NSOperationQueue new]; NSArray * params = [NSArray arrayWithObjects: [[

    3熱度

    1回答

    我得到這個消息: 「(空):無法識別的選擇發送到0x3f52e824類」 的基本代碼我已經試過: SEL sel = @selector(applyProperties:toObject:); NSInvocation* inv = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:sel]

    0熱度

    3回答

    我想以一種按下它的方式編程添加一個按鈕,某個對象正在傳遞。我一直在收到「無法識別的選擇器發送」異常。你可以建議什麼是錯的代碼: // allocate the details button's action SEL selector = @selector(showPropertyDetails:forProperty:); NSMethodSignature *signatu

    0熱度

    2回答

    我需要將touchesBegan的觸摸和事件傳遞給由performSelector調用的我自己的方法。我正在使用NSInvocation來打包參數,但是我遇到了目標問題。 我這樣做的原因是我可以處理其他滾動事件。 這裏是我的代碼: - (void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event { UITo