Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-14-2010, 05:31 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2010
Location: Silverstone, UK
Posts: 8
Philips is on a distinguished road
Default Prob with map annotation callout navigation

I am loath to ask the community because I really like to resolve problems myself. However, I have been having no luck with this for two long despite a lot of effort. The thing is that I am sure there is a really simple solution and I am just not getting it <blush>

I have a tab-controller with four items. Two of these are table views which work fine and navigate to detail views.

The problem is a map view. This works fine and places annotations in the correct lat/lon location. Click on the annotation and the callout displays with a button which is supposed to navigate to a detail view. For reasons unknown it does not respond.

Anyone any ideas?
Philips is offline   Reply With Quote
Old 12-14-2010, 10:05 AM   #2 (permalink)
Registered Member
 
Join Date: Feb 2010
Location: Switzerland
Posts: 64
omah is on a distinguished road
Default

Hi, If the map is from UIImageView you need to add:
m_xMyImageView.userInteractionEnabled = YES;
if you create it using IB there is a check button for it there.
Hope it helps
omah is offline   Reply With Quote
Old 12-14-2010, 10:18 AM   #3 (permalink)
Registered Member
 
Join Date: Oct 2009
Location: Amsterdam, The Netherlands
Posts: 782
TUX2K is on a distinguished road
Default

How did catch the click on the annotion?

Did you use:
Code:
- (void) mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
Also did you set the delegate of the map to your class?
TUX2K is offline   Reply With Quote
Old 12-14-2010, 05:22 PM   #4 (permalink)
Registered Member
 
Join Date: Oct 2010
Location: Silverstone, UK
Posts: 8
Philips is on a distinguished road
Default hi

Quote:
Originally Posted by TUX2K View Post
How did catch the click on the annotion?

Did you use:
Code:
- (void) mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
Also did you set the delegate of the map to your class?


I set the map / annotations / detail view up standalone and it all works. Does not work when I incorporate it into the app using the tab-bar. This is the code for the button action:


- (IBAction)showLinksid)sender
{
int nrButtonPressed = ((UIButton *)sender).tag;

if (nrButtonPressed < 99999) {
if (self.showDetailView == nil) {
detailView *tmpViewController = [[detailView alloc] initWithNibName:@"detailView" bundle:nil];
self.showDetailView = tmpViewController;
[tmpViewController release];
}
[self.navigationController pushViewController:self.showDetailView animated:YES];
if (nrButtonPressed == 1) {
[self.showDetailView.detailDescription setText:@"Description 1"];
}
if (nrButtonPressed == 2) {
[self.showDetailView.detailDescription setText:@"Description 2"];
}
self.showDetailView.title = @"Detail";
}
}
Philips is offline   Reply With Quote
Old 12-15-2010, 07:03 AM   #5 (permalink)
Registered Member
 
Join Date: Oct 2010
Location: Silverstone, UK
Posts: 8
Philips is on a distinguished road
Default

Quote:
Originally Posted by omah View Post
Hi, If the map is from UIImageView you need to add:
m_xMyImageView.userInteractionEnabled = YES;
if you create it using IB there is a check button for it there.
Hope it helps
Hi. Yes, I have user interaction enabled. The button 'clicks' but does not do anything

best

Philip
Philips is offline   Reply With Quote
Reply

Bookmarks

Tags
annotation callouts, map, navigation buttons

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 391
9 members and 382 guests
chemistry, daudrizek, HemiMG, jeroenkeij, Kirkout, PavelMik, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,665
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, daudrizek
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:58 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0