我在學習hook logos語法但遇到了錯誤
#import <CaptainHook/CaptainHook.h>
%hook ViewController 錯誤代碼Expected identifier or '('
- (void)testFunc {
// 在原始函式之前執行的程式碼
NSLog(@"Before testFunc is called.");
// 調用原始函式
%orig;
// 在原始函式之後執行的程式碼
NSLog(@"After testFunc is called.");
}
%end 錯誤代碼Expected identifier or '('
CHConstructor {
%init(ViewController);
%hook(ViewController);
}
請問如何解決