New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
iOS Development Discussion on developing apps for the iOS platform.

Drawing Annotations to Map? Help!!

Post Reply New Thread Subscribe

Thread Tools

Member Since: Mar 08, 2011
Posts: 4
Jakesta42 is on a distinguished road

Jakesta42 is offline
So I have a problem. I'm making an app in which I need to have multiple annotations of different colors on a MapView object. But when I draw the annotations to the map, only one appears. I've implemented the appropriate protocols and overridden the viewForAnnotation method that draws points to the screen. But still only one lonesome annotation gets drawn!

The method updateNodes is supposed to go through an array called allParties, and populate another array called arr with annotation objects. I then attempt do draw the array of annotations using the addAnnotations method.

Here's my code:
-(void) updateNodes{
    NSMutableArray *arr = [[NSMutableArray alloc] init];
    for(Party *party in allParties){
            party.alreadyAdded = YES;
             MKAnnotationView *partyPin = [self returnPointView:[party getPartylocation] 	     andTitle:[party getPartyName] andColor:[party getPartyColor]];
            [partyPin.annotation setCoordinate:partyPin.annotation.coordinate];
            [arr addObject:partyPin.annotation];
            NSLog(@"Adding Successful!");
    [ addAnnotations:arr];
-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation{
    NSLog(@"Map View Method Called");
    MKPinAnnotationView *pinView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil];
    return pinView;

I'm clearly doing something wrong. How can I get it so that:

(a) The annotations are of different colors (meaning multiple-colored annotations)
(b) The annotations actually are on the map!
QUOTE Thanks

Post Reply New Thread Subscribe

« Custom Pin Issue | To create single static(.a)library from several static(.a)files in iphone »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
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 Off
Forum Jump

Similar Threads
Thread Starter
Last Post
TomTom, Apple sign global agreement for map data in iOS 6 OneMoreThing... Apple Rumors and Reports 0 06-12-2012 06:20 PM
Google map problem willwork4food68 Schweb's Lounge 1 12-03-2010 05:30 PM
Map drawing software jhilera Images, Graphic Design, and Digital Photography 1 03-28-2010 03:09 PM
Drawing lines on a map scudman Images, Graphic Design, and Digital Photography 2 03-05-2007 02:42 AM

All times are GMT -4. The time now is 01:46 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?