有誰知道爲什麼我得到一個鏈接錯誤,當我嘗試編譯下面的代碼:鏈接對CoreTelephony框架(IOS)
extern void * _CTServerConnectionCreate(CFAllocatorRef, int (*)(void *, CFStringRef, CFDictionaryRef, void *), int *);
int callback(void *connection, CFStringRef string, CFDictionaryRef dictionary, void *data)
{
return 0;
}
%hook UIKeyboard
-(id)hitTest:(CGPoint)test withEvent:(id)event
{
int x = 0;
_CTServerConnectionCreate(kCFAllocatorDefault, callback, &x);
return %orig;
}
%end
使輸出爲:
爲未定義的符號架構armv6: 「CTServerConnectionCreate( _CFAllocator const *,int()(void,__CFString const *,__CFDictionary const *,void *),int *)」,reference, d從: $ _ungrouped $ UIKeyboard $ hitTest $ withEvent $(UIKeyboard *,objc_selector *,CGPoint,objc_object *)in Tweak.xm.o ld:symbol(s)not for架構armv6 collect2:ld返回1出口狀態
一些注意事項:
- 我對CoreTelephony鏈接與-framework CoreTelephony
- 我使用的代碼從這裏Core Telephony Example
- 我試圖在兩者的iOS 4.x和5.x的iOS版
- 我用納米,確保函數調用內部的二元
是的我是一個越獄的設備上。
謝謝;)