मैं अटक गया हूं :(
मेरे आवेदन में मुझे हर बार एक नई स्थिति में अपडेट होने पर CLLocationManager से एक अपडेट की आवश्यकता होती है। मैं XIB/NIB फ़ाइलों का उपयोग नहीं कर रहा हूं, मैंने जो कुछ भी कोड किया है, मैंने कोडेटिक रूप से किया है। :
जएक्सआईबी फाइलों के बिना प्रोग्रामिक रूप से एक्सकोड में यूआईएलएबल को कैसे अपडेट करें?
@interface TestViewController : UIViewController
UILabel* theLabel;
@property (nonatomic, copy) UILabel* theLabel;
@end
मीटर
...
-(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]];
}
...
कोई भी विचार, या मदद
(यह सब हाथ जाम किया गया था तो कृपया मुझे माफ़ कर दो अगर यह थोड़े गले लगते हैं) यदि आवश्यक हो तो मैं अधिक जानकारी प्रदान कर सकता हूं।
क्या एनएसएलओजी सही स्थान दिखाता है? – GorillaPatch
क्या आपका मतलब व्यूडिडलोड नहीं था? –
@Radek मैंने इसे loadView में रखा है, क्या UILabel को डीडलोड में देखा जाना चाहिए? क्या यह ओवरराइड बिंदु है? और यह UILabel mutable –