AppDelegate.h 错误 - XCode [英] AppDelegate.h errors - XCode
问题描述
这真的很奇怪.今天从学校回来并启动我的 Mac Mini 时,我打开了 Xcode,在我的 AppDelegate.h
文件中出现了两个错误.这些错误之一是Expected selector for Objective-C method
,另一个是Expected method body
.我在谷歌上搜索了这两个错误,但没有发现可以解决我的情况.我试过重新启动 Xcode 和我的电脑.我也尝试过清理"项目,但我的问题仍未解决.这个错误可能是什么?是在我的尽头吗?或者这是一个Xcode错误?谢谢:
This is really weird. When coming back from school today and firing up my Mac Mini, I open up Xcode and I am presented with two errors in my AppDelegate.h
file. One of these errors says Expected selector for Objective-C method
and the other one is Expected method body
. I googled these two errors and found nothing that could solve my case. I have tried restarting Xcode and as well as my computer. I have also tried "Cleaning" the project and still my problem is not resolved. What could this error be? Is it on my end? Or is this an Xcode bug? Thanks:
代码:AppDelegate.h
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UINavigationController *navigationController;
@end
推荐答案
检查您的 main.m 文件是否有任何额外或不可见的代码:
Check Your main.m File for any extra or invisible Code:
//
// main.m
// Demo
//
// Created by Stackoverflow on 12/20/12.
//
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
这篇关于AppDelegate.h 错误 - XCode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!