所以我在几个小时内一直在寻找为什么我的 iPhone 应用程序讨厌我。这是我得到的错误:警告:“speedView”的本地声明隐藏了实例变量。这是我的 .m 文件
@implementation MainViewController
@synthesize speedCount;
@synthesize speedView;
@synthesize popoverController;
- (void)setspeedView:(UILabel *)speedView
{
[speedView setText: [NSString stringWithFormat:@"%d",speedCount]];
speedCount = 0;
speedCount++;
}
.h 文件
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface MainViewController : UIViewController <LoginDelegate,WEPopoverParentView,PopoverControllerDelegate,MainMenuDelegate,MKMapViewDelegate,UIActionSheetDelegate,UIAccelerometerDelegate, CLLocationManagerDelegate>
{
AppDelegate *appDelegate;
IBOutlet MKMapView *userMap;
IBOutlet UILabel *speedView;
CLLocationManager *locationManager;
}
@property (strong, nonatomic) IBOutlet UILabel *speedView;
@property(nonatomic) int speedCount;
我真的不明白为什么它说我隐藏了实例变量。