我在点击一个图钉时尝试添加一个视图,但只显示标题和副标题,而不是我添加的视图.
这是我的代码
-(void) inserirMapa {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
NSMutableArray *pins = [[NSMutableArray alloc]init]; //array de Annotations
for(int iCnt = 0; iCnt < [_listaPins count]; iCnt++) {
Pin *pin = (Pin *) [_listaPins objectAtIndex:iCnt];
CLLocationCoordinate2D start;
start.latitude = pin.place.latitude;
start.longitude = pin.place.longitude;
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(start, 800, 800);
[_myMapView setRegion:[_myMapView regionThatFits:region] animated:YES];
// Add an annotation
MKPointAnnotation *point = [[MKPointAnnotation alloc] init];
point.coordinate = start;
point.title = @"Where am I?";
point.subtitle = @"I'm here!!!";
[_myMapView addAnnotation:point];
[pins addObject:point];//adiciona …Run Code Online (Sandbox Code Playgroud)