English 中文(简体)
Iphone CLococation Coordination
原标题:Iphone CLLocationCoordinate2D

我是新话,我有问题。

我有这部法律。

for (int i=0; i<2; i++) {
    Datos *datos = (Datos *)[arr_datos objectAtIndex:i];
    CLLocationCoordinate2D coord;
    AnnotationItem *annotationItem = [[AnnotationItem alloc] init];
    coord.latitude =[datos.latitud doubleValue];
    coord.longitude = [datos.longitud doubleValue];

    NSLog(@"coord %f",coord.longitude);
    NSLog(@"coord %f",coord.latitude);
    [annotationItem setCoordinate:coord];
    //[annotationItem setEstacion:estacion];

    [mapView_ addAnnotation:annotationItem];
    [annotationItem release];

}

The problem that it doesn t done anything

但是,如果对<代码>coord.latitude=40.444和coord.longized=-3.700;

这给我带来了我希望的东西,但我不想这样做,因为我有一阵列,有许多纬度和长足。 谁能帮助我这样做? i 带上<条码>coord.longized=[datos.longizedrotValue];, 它做的是t work?

I m using Xcode 3.2.2

感谢和宽恕我。

问题回答

问题在于,我改变了价值观,而我却把错误的价值观放在一边。 我必须做的是改变。

coord.latitude =[datos.longitud doubleValue]; 
coord.longitude = [datos.latitud doubleValue]; 

谢谢大家。

这似乎与Datos一样,是你界定的一个目标,因为ionet在SDK中发现。 鉴于这有几个不同之处:

  • Either that arr_datos does not have the correct (or any) data inside of it
  • It could be that the Datos object is incorrectly handling data passed into it and not storing it correctly.

在X条码中设置一个空白点,并核实:arr_datos有你认为自己掌握的信息,而Datos物体正确存储信息。

CLocation Co.2D 不是这样声明的物体:

 CLLocationCoordinate2D coord;

BTW, you should be getting warnings about CLLocationCoordinate2D *coord - can you check your compiler logs?

[suggestion1]

NSLog(@"datos.lon %@", datos.longitud);
NSLog(@"datos.lat %@", datos.latitud);

[/建议1]

[suggestion2]

并请注意,你可以通过你的所有敢于:

for(Datos *datos in datos_arry) {
    NSLog(.....);
}

[/建议2]





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签