开发者

iPhone: Confused about what this method declaration is saying

开发者 https://www.devze.com 2023-01-27 09:55 出处:网络
I am new to iPhone.Can someone explain this method declaration to me: - (void)locationManager:(CLLocationManager *)manager

I am new to iPhone. Can someone explain this method declaration to me:

- (void)locationManager:(CLLocationManager *)manager
       didFailWithError:(NSError *) error{

Here is what I am guessing:

  • (void) - method does not return anything
  • locationManager: - ???
  • (CLLocationManager *)manager - this looks like a parameter. To a CLLocationManager.
  • didFailWithError: - This seems like the method name
  • (NSError *) error - This also seems like a parameter开发者_JAVA百科. I am somewhat confused about why there are parameters in two locations.


This is Objective C, not regular C, so the function name is interspersed with the parameters. locationManager and didFailWithError are both part of the function name.


Have a a look here: http://cocoadevcentral.com/d/learn_objectivec/

0

精彩评论

暂无评论...
验证码 换一张
取 消