简体   繁体   English

错误“在类型为“ MyAnnotation”的对象上找不到属性“标题””

[英]Error “ Property 'title' not found on object of type 'MyAnnotation' ”

I'm following this tutorial http://mayurbirari.wordpress.com/2011/02/07/how-to-access-mkmapkit-in-iphone/ to set annotations on a map in my IOS app , but I got 13 errors : 我正在按照本教程http://mayurbirari.wordpress.com/2011/02/07/how-to-access-mkmapkit-in-iphone/在IOS应用程序中的地图上设置注释,但出现13个错误:

  • " Property 'title' not found on object of type 'MyAnnotation' " ( 4 times ) “在类型为“ MyAnnotation”的对象上找不到属性“标题””(4次)
  • " Property 'subtitle' not found on object of type 'MyAnnotation' " ( 4 times ) “在类型为'MyAnnotation'的对象上找不到属性'subtitle'”(4次)
  • " Property 'coordinate' not found on object of type 'MyAnnotation' " (4 times ) “在类型为'MyAnnotation'的对象上找不到属性'coordinate'(4次)
  • " Property 'coordinate' not found on object of type 'id' " ( 1 time) “在类型'id'的对象上找不到属性'coordinate'(1次)

I get those mistakes one time for each annotation, and I've added 4 annotations ( that's why there are 4 times each mistake). 对于每个注解,我都会一次得到这些错误,并且我添加了4个注解(这就是每个错误有4次的原因)。 I really don't know what to do , I've tried many things but It didn't work . 我真的不知道该怎么做,我已经尝试了很多东西,但是没用。 I'm a beginner in Objective-C so it is probably a really stupid mistake but I can't see it ! 我是Objective-C的初学者,所以这可能是一个非常愚蠢的错误,但我看不到!

Pictures of the code: 代码图片:

Your annotation objects should be objects that conform to the MKAnnotation protocol. 您的注释对象应该是符合MKAnnotation协议的对象。 I'm guessing that your implementation of the protocol methods is not compliant. 我猜想您对协议方法的实现不兼容。

Show what you have for those methods (which should be within your MyAnnotation object), if you don't see any obvious errors along this line of thought. 如果您没有发现任何明显的错误,请说明这些方法的用途(应该在MyAnnotation对象中)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在类型为“ ...”的对象上找不到错误属性“ ...” - I get the error Property '…' not found on object of type '…' 错误:在类型为“ id”的对象上找不到属性“数据” - Error: property 'data' not found on object of type 'id' 错误:在“ UIView *”类型的对象上找不到属性“ frame” - error: property 'frame' not found on object of type 'UIView *' 属性未找到类型的对象 - property not found an object of type 在类型的对象上找不到属性 - Property not found on object of type 错误:在类型'UITableViewCell'的对象上找不到属性'label1' - Error: property 'label1'not found on object of type 'UITableViewCell' Xcode 错误:语义问题,在对象类型“GKEntity *”上找不到属性“className” - Xcode error: Semantic Issue, Property 'className' not found on object type 'GKEntity *' 工作灯-错误:在类型为'CDVInvokedUrlCommand *'的对象上找不到属性'callbackId' - Worklight - error: property 'callbackId' not found on object of type 'CDVInvokedUrlCommand *' Xcode CodeSense错误-在类型的对象上找不到属性,但项目可以编译 - Xcode CodeSense error - Property not found on object of type, but project compiles 需要修复代码“在'id'类型的对象上找不到属性'managedObjectContext'的错误。” - need to fix error in code “Property 'managedObjectContext' not found on object of type 'id'.”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM