Я застрял: (
В моем приложении мне требуется обновление от CLLocationManager каждый раз, когда он получает обновление до новой позиции. Я не использую файлы XIB / NIB, все, что я кодировал, я делал программно. На код:
.h
@interface TestViewController : UIViewController
UILabel* theLabel;
@property (nonatomic, copy) UILabel* theLabel;
@end
.m
...
-(void)loadView{
....
UILabel* theLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0,0.0,320.0,20.0)];
theLabel.text = @"this is some text";
[self.view addSubView:theLabel];
[theLabel release]; // even if this gets moved to the dealloc method, it changes nothing...
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"Location: %@", [newLocation description]);
// THIS DOES NOTHING TO CHANGE TEXT FOR ME... HELP??
[self.view.theLabel setText:[NSString stringWithFormat: @"Your Location is: %@", [newLocation description]]];
// THIS DOES NOTHING EITHER ?!?!?!?
self.view.theLabel.text = [NSString stringWithFormat: @"Your Location is: %@", [newLocation description]];
}
...
Есть идеи или помощь?
(все это было заклинило рукой, так что, пожалуйста, простите меня, если это выглядит как-то приколотым) Я могу предоставить дополнительную информацию, если потребуется.