Hi I'm very new to ios development.
I'm developing a map application where I use mapkit. I have a viewController with the map view and a corresponding viewController class.
Now I would like to manipulate the mapView, and is trying to set up the delegate. BUT i can't ctrl+drag anything (includes the mapView) to my header-file. So what do I do then??
I've tried to write the auto implemented stuff in my header-file but this isn't working either :(
Any help is really appreciated..
Here's my header-file:
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#define METERS_PER_MILE 1609.344
@interface MapViewController : UIViewController<MKMapViewDelegate> {
}
@property (weak, nonatomic) IBOutlet MKMapView *mapView;
@end
And a note to ios developers what the hell is this drag and drop doing in a IDE?!?
Here are the steps to create an IBOutlet in XCode:
xib
/ Storyboard
to edit it in Interface BuilderAssistant editor
is visible. If not click on this icon:
IBOutlet
I hope that this will clarify the whole procedure for you. Note that this is only a convenience. You could manually declare the IBOutlet
and connect it to your view as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With