我想为我的 uilabel 更新整数以提高速度,但它似乎不起作用。很抱歉这个基本问题,但这让我有一段时间感到不安。我创建了一个 mainviewcontroller.xib 视图并尝试设置我的 Uilabel,但它们没有更新. 我的 uilabel 叫做 speedView
- (void)viewDidLoad {
[super viewDidLoad];
CLController = [[CoreLocationController alloc] init];
CLController.delegate = self;
[CLController.locMgr startUpdatingLocation];
}
- (void)locationUpdate:(CLLocation *)location {
NSNumber *speedCount = [NSNumber numberWithInt:1];
[speedView setText: [NSString stringWithFormat:@"number is %@d",speedCount]];
}
- (void)locationError:(NSError *)error {
speedView.text = [error description];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return YES;
}
- (void)viewDidUnload {
}
- (void)dealloc {
[CLController release];
[super dealloc];
}
@end
@interface MainViewController : UIViewController <LoginDelegate,WEPopoverParentView,PopoverControllerDelegate,MainMenuDelegate,MKMapViewDelegate,UIActionSheetDelegate, CLLocationManagerDelegate>
{
AppDelegate *appDelegate;
IBOutlet MKMapView *userMap;
IBOutlet UILabel *speedView;
}
@property (strong, nonatomic) IBOutlet UILabel *speedView;
@property(nonatomic) int speedCount;
- (void)setSpeedView:(UILabel *)speedView;
有没有人建议我一个想法?我想。任何想法为什么价值没有通过?