IB为什么看不到我的IBAction? [英] Why doesn't IB see my IBAction?
问题描述
我盯着这个眼睛已经太久了.
I've been staring at this for way too long.
这里没有任何花哨的事情发生,我已经做了数十次,但是Interface Builder坚决拒绝为我提供-(IBAction)slideDirections
的操作目标.我正处于愿意公开发布并感到愚蠢的地步.所以,让我们撕裂.
There's nothing fancy happening here, and I've done this dozens of times, yet Interface Builder steadfastly refuses to provide me an action target for -(IBAction)slideDirections
. I'm at the point where I'm willing to post publicly and feel stupid. So let 'er rip.
这是我的.h:
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface PulseDetailController : UIViewController {
NSDictionary *pulse;
IBOutlet MKMapView *map;
IBOutlet UIWebView *directions;
IBOutlet UIView *directionsSlider;
BOOL directionsExtended;
IBOutlet UILabel *vendor;
IBOutlet UILabel *offer;
IBOutlet UILabel *offerText;
IBOutlet UILabel *hours;
IBOutlet UILabel *minutes;
IBOutlet UILabel *seconds;
IBOutlet UILabel *distance
}
@property (nonatomic, retain) NSDictionary *pulse;
@property (nonatomic, retain) MKMapView *map;
@property (nonatomic, retain) UIWebView *directions;
@property (nonatomic, retain) UIView *directionsSlider;
@property (nonatomic) BOOL directionsExtended;
@property (nonatomic, retain) UILabel *vendor;
@property (nonatomic, retain) UILabel *offer;
@property (nonatomic, retain) UILabel *offerText;
@property (nonatomic, retain) UILabel *hours;
@property (nonatomic, retain) UILabel *minutes;
@property (nonatomic, retain) UILabel *seconds;
@property (nonatomic, retain) UILabel *distance;
-(IBAction)slideDirections;
@end
推荐答案
有时Interface Builder似乎与Xcode中的类不同步.您是否尝试过强迫接口构建器重新读取PulseDetailController头文件? (File -> Read Class Files... -> Select 'PulseDetailController.h'
).这将强制Interface Builder查看您的新操作.
Sometimes Interface Builder seems to get out of sync with classes in Xcode. Have you tried forcing interface builder to reread your PulseDetailController header file? (File -> Read Class Files... -> Select 'PulseDetailController.h'
). This should force Interface Builder to see your new action.
这篇关于IB为什么看不到我的IBAction?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!