开发者

MkMapView causes Circular reference

开发者 https://www.devze.com 2023-02-17 06:37 出处:网络
I try to use MapKit.h and get stuck in my very first lines of code. My interface looks like this: #import <UIKit/UIKit.h>

I try to use MapKit.h and get stuck in my very first lines of code.

My interface looks like this:

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface MapViewController : UIViewCon开发者_JAVA技巧troller <MKMapViewDelegate> {
    IBOutlet MkMapView *iMap;      <---- POINT OF ERROR
}
@property (nonatomic, retain) IBOutlet MkMapView *iMap;
@end

and get error Expected qualifier-specifier-list before 'MkMapView'.

I read several posts on circular references and that I should move the #import <MapKit/MapKit.h> statement to the implementation and added the @class MkMapView statement.

As a result the error vanished, but I now cannot link iMap to the MkMapView in the Xib file.

Am in an endless loop. Where am I going wrong?


You don't need the @class.
MkMapView should be MKMapView (uppercase K).

0

精彩评论

暂无评论...
验证码 换一张
取 消