我在viewDidLoad中有以下循环:
for(int i=1; i<[eventsArray count]; i++) {
NSArray *componentsArray = [[eventsArray objectAtIndex:i] componentsSeparatedByString:@","];
if([componentsArray count] >=6) {
Koordinate *coord = [[Koordinate alloc] init];
coord.latitude = [[componentsArray objectAtIndex:0] floatValue];
coord.longtitude = [[componentsArray objectAtIndex:1] floatValue];
coord.magnitude = [[componentsArray objectAtIndex:2] floatValue];
coord.depth = [[componentsArray objectAtIndex:3] floatValue];
coord.title = [componentsArray objectAtIndex:4];
coord.strasse = [componentsArray objectAtIndex:5];
coord.herkunft = [componentsArray objectAtIndex:6];
coord.telefon = [componentsArray objectAtIndex:7];
coord.internet = [componentsArray objectAtIndex:8];
[eventPoints addObject:coord];
}
Run Code Online (Sandbox Code Playgroud)
coord是CLLocationCoordinate2D
但是我如何在下面的方法中使用coord,因为我需要这个以获得两个坐标之间的距离:
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation{
}
Run Code Online (Sandbox Code Playgroud)
请帮帮我,我被困了!
谢谢大家事先帮忙
在下面的按钮是显示的地址.我的问题是地址很长,我怎么能在按钮标题中的两个变量之间得到一个断裂线?
NSString *sitz = map.kordinate.herkunft;
NSString *strasse = map.kordinate.strasse;
NSString *strasseMitKomma = [strasse stringByAppendingString:@","];
NSString *fertigesSitzFeld = [strasseMitKomma stringByAppendingString:sitz];
UIButton *firmensitz = [UIButton buttonWithType:UIButtonTypeRoundedRect];
Run Code Online (Sandbox Code Playgroud)
断裂线必须介于strasseMitKomma和sitz之间?
谢谢你的帮忙
我已经实现了一个小的viewDidLoad()来显示具有自动调整功能的图片,但它不起作用,可以请某人帮助我并说出这行代码在第3行和第4行中的错误是什么?
imageView = [[UIImageView alloc] initWithImage:img];
imageView.frame = self.view.frame;
imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
Run Code Online (Sandbox Code Playgroud)
我希望有人可以帮助我?
如何在我的应用程序中拨打一个已输入的号码UITextField?
我有个问题.我已经实现了一个包含phonenumber的UITextField,然后我实现了以下方法来拨打电话号码:
- (void)rufeAn{
NSString *prefix = (@"tel://");
UIApplication *app = [UIApplication sharedApplication];
NSString *dialThis = [NSString stringWithFormat:@"%@%@", prefix, map.kordinate.telefon];
NSURL *url = [NSURL URLWithString:dialThis];
[app openURL:url];
Run Code Online (Sandbox Code Playgroud)
}
但是当我触摸它时,我怎么能对textField说,启动方法并拨号?
iphone ×5
cocoa-touch ×2
uitextfield ×2
ios ×1
nsstring ×1
phone-call ×1
uibutton ×1
viewdidload ×1