问题描述
大家好,我在Facebook App中进行了第一次调整以执行简单的任务,但是我试图在项目中使用FCAlertView警报https://github.com/nimati/FCAlertView,我使用此代码在Facebook主页中查看警报
#import <UIKit/UIKit.h>
#import <CoreGraphics/CoreGraphics.h>
#import "FCAlertView.h"
#import <MessageUI/MessageUI.h>
%config(generator=internal)
%hook FBBaseAppDelegate
- (void)applicationDidBecomeActive:(id)arg1 {
%orig;
FCAlertView *alert = [[FCAlertView alloc] init];
[alert showAlertWithTitle:@“Test Alert"
withSubtitle:@"This is alert's subtitle."
withCustomImage:nil
withDoneButtonT itle:nil
andButtons:nil];
}
%end
但是有错误
“未定义符号:OBJC_CLASS $ _FCAlertview”
我正在使用xcode(单独的猴子)进行调整
解决方法
在构建代码时,gcc无法找到FCAlertView的定义位置,因为您没有对其进行编译。
对于MonkeyDev:
确保FCAlertView.m位于您的项目中,并将其添加到正确的目标中
对于theos:
您应将所有源文件(在本例中仅为FCAlertView.m
)添加到_FILES参数内的Makefile中。
像这样:
YOURTWEAKNAME_FILES = main.m FCAlertView.m