0
現在、私は私の経度と緯度の座標値を保持する2つのテキストフィールドを持っています。何らかの理由で座標の最後にN、S、E、Wを入力して方向を指定すると無視され、数値だけが取り込まれ、インターンは誤った場所に移動します。経度と緯度の方向を指定できません
これまで何をしていたのですか?
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
mapview.showsUserLocation = YES;
MKCoordinateRegion region = { {0.0, 0.0}, {0.0,0.0}};
region.center.latitude = [self.myTextField.text floatValue];
region.center.longitude = [self.myTextField1.text floatValue];
region.span.longitudeDelta = 0.01f;
region.span.latitudeDelta = 0.01f;
[mapview setRegion:region animated:YES];
MapPin *ann = [[MapPin alloc] init];
ann.title = @"Test";
ann.subtitle = @"test";
ann.coordinate = region.center;
[mapview addAnnotation:ann];
}
テキストフィールドにはフォーマッタが添付されていますか?おそらく数字だけを受け入れるものでしょうか? – trojanfoe
いいえ、私はどのようにフォーマッタをつけますか? – vype
実際には、デリゲートを書式設定に使用する必要があります。 – trojanfoe