小编Mar*_*rco的帖子

CLLocationCoordinate2D到CLLocation

我在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)

请帮帮我,我被困了!

谢谢大家事先帮忙

iphone cocoa-touch cllocationmanager

24
推荐指数
3
解决办法
4万
查看次数

UIButton头衔的Breakline

在下面的按钮是显示的地址.我的问题是地址很长,我怎么能在按钮标题中的两个变量之间得到一个断裂线?

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之间?

谢谢你的帮忙

iphone uibutton nsstring

2
推荐指数
1
解决办法
3596
查看次数

autoResizingMask中的错误

我已经实现了一个小的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)

我希望有人可以帮助我?

iphone viewdidload autoresizingmask

2
推荐指数
1
解决办法
774
查看次数

使用UITextField中的号码拨打电话

如何在我的应用程序中拨打一个已输入的号码UITextField

iphone cocoa-touch uitextfield ios

1
推荐指数
1
解决办法
1164
查看次数

从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 phone-call uitextfield

0
推荐指数
1
解决办法
408
查看次数