Why can't IB see my IBAction?

I have been looking at this for too long.

Nothing happens here, and I did it dozens of times, but Interface Builder steadily refuses to provide me with a target for -(IBAction)slideDirections. I am at a point where I am willing to publicly publish and feel stupid. So allow yourself a rip.

Here is my .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
+3
source share
3 answers

Sometimes the Builder interface does not seem to synchronize with classes in Xcode. Have you tried to force an interface builder to re-read your PulseDetailController header file? ( File -> Read Class Files... -> Select 'PulseDetailController.h'). This should make Interface Builder see your new action.

+3

IBAction ? :

-(IBAction)slideDirections:(id)sender;
+6

What objects are you trying to connect? From your title, the logical choice will be. UIView *directionsSlider If you drag ctrl from directionsSliderto the Owner File object, make sure that the class in File Owner is set to PulseDetailController.

0
source

Source: https://habr.com/ru/post/1749259/


All Articles