开发者

iPhone: Confused about what this method declaration is saying

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜