我一直盯着这个太久了。
这里没有任何花哨的事情,我已经做了好几次,但Interface Builder坚决拒绝为我提供-(IBAction)slideDirections
的行动目标。我正处于公开发布并感到愚蠢的地步。所以,让我们撕裂。
这是我的.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
答案 0 :(得分:6)
IBAction
不应该有发件人参数吗?
像:
-(IBAction)slideDirections:(id)sender;
答案 1 :(得分:3)
有时Interface Builder似乎与Xcode中的类不同步。您是否尝试过强制界面构建器重新读取PulseDetailController头文件? (File -> Read Class Files... -> Select 'PulseDetailController.h'
)。这应该强制Interface Builder查看您的新操作。
答案 2 :(得分:0)
您要连接哪些对象?
从标题中,逻辑选择为UIView *directionsSlider
如果您从directionsSlider
拖动到“文件所有者”对象,请确保“文件所有者”中的类设置为PulseDetailController
。