Nav Link On

iPhone Dev Forums > General Development > SDK Coding Help > Mapkit and function syntax

Reply

 

LinkBack Thread Tools Display Modes
Old 07-15-2009, 03:09 PM   #1 (permalink)
Junior Member
Default Avatar
 
Join Date: Jun 2009
Posts: 6
Default Mapkit and function syntax

Ok, this isn't really a mapkit question, but just a problem I had while doing a mapkit tutorial..

Something that's confusing me a little bit, and this feels kinda like a stupid question! I did this tutorial and have since successfully incorporated it into my own project but I don't understand exactly what this is:

Code:

You must Login or Register to view and contribute code! This is done to increase participation in helping one another out, if you have been helped please pass on the favor.

- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
	MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"];
	annView.pinColor = MKPinAnnotationColorGreen;
	annView.animatesDrop=TRUE;
	annView.canShowCallout = YES;
	annView.calloutOffset = CGPointMake(-5, 5);
	return annView;
}

Is it a function? This kind of thing with the -(blabla *)bla: syntax has been throwing me off, what's with the star? If it's a function what is the name of the function, how is it actually called? I'm not sure what questions I should be asking to be honest, I just don't understand it!

The reason it's causing me trouble is as I step through his code (the sample I downloaded that's up there with the tutorial), it jumps to this function at a certain point, but with mine it doesn't. Yet, commenting it out makes no difference to my code, while commenting his out simply switches the pin back to default colour of red (As it is specified as green in this function) but it still has no problem dropping the pin there. I don't know what I did or changed in my code that it doesn't run through this, the code looks exactly the same to me!

Any help explaining what the function thing actually is would be much appreciated, I get the feeling this is a kinda stupid question and that I should really know this by now!
DoaneLinde is offline   Reply With Quote
Reply

iPhone Dev Forums > General Development > SDK Coding Help


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


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC1