编译时出错:控件可能到达非空函数的末端
Error when compiling: control may reach end of non-void function
我正在尝试在我的设备上使用theos创建我的第一个移动基质调整但是当我编译我得到这个错误
我Tweak.xm调整。xm:23:1: error: control may reach end of non-void function [-Werror,- return-type]
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
static NSMutableDictionary *plist = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.myplist.customwapprefs.plist"];
static BOOL pictureFit = NO;
static id connection = nil;
%hook WAPhotoMoveAndScaleViewController
- (BOOL)mustScaleToFill {
pictureFit = [[plist objectForKey:@"photofit"]boolValue];
if (pictureFit) {
return NO;
}
else if (!pictureFit) {
return %orig;
}
}
%end
请具体一点,我是新来的objective-c和所有这些,谢谢
if (pictureFit) {
return NO;
}
else if (!pictureFit) {
return %orig;
}
您不需要else
部分中的第二个条件。删除它,编译器应该高兴
相关文章:
- 类中私有结构的构造函数出错
- 字符串验证函数出错
- 我的类默认构造函数出错
- Dev-C++和Code::Blocks中的析构函数出错
- int对的哈希函数出错
- MSVC 编译器错误导致迭代器和友元函数出错
- 复制构造函数出错
- 使用 WinSock2 开发,使用 CreateThread() 函数出错
- 链接列表的Push_back函数出错
- 结构初始化中的隐式复制构造函数出错
- 异步函数出错
- 编译器错误消息错误:令牌之前的预期')' '*'。我的构造函数出错
- c++中使用std::bind和std::函数出错
- 在vector排序中使用c++模板函数出错
- 使用std::for_each lambda函数出错
- 二叉搜索树插入函数出错
- 调用类的函数出错
- c++使用删除函数出错
- 使用已删除的函数出错
- 调用构造函数出错