我正在尝试编写一个全局函数,但是当我尝试调用它时不断收到错误“没有可见的界面......”。
弹出框.h
#import <Foundation/Foundation.h>
@interface Popover : NSObject{}
- (void)PopoverPlay;
@end
弹出框.m
#import "Popover.h"
@implementation Popover
- (void)PopoverPlay{
NSLog(@"I Work");
}
@end
在 View.mi 中添加导入“Popover.h”,但当我尝试运行时无法摆脱错误消息。
#import "View.h"
#import <QuartzCore/QuartzCore.h>
#import "Popover.h"
@interface View ()
{
}
@end
@implementation View
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)didReceiveMemoryWarning{
[super didReceiveMemoryWarning];
}
- (void)viewDidLoad{
[super viewDidLoad];
}
- (IBAction)ButtonPress {
[self PopoverPlay];
}
任何想法谢谢