let placemark = MKPlacemark(coordinate: self.coordinate,addressDictionary: addressDict)
错误在标题上描述.包含这一行的方法是:
func mAPItem() -> MKMAPItem { let addressDict = [String(kABPersonAddressstreetKey): self.subTitle] let placemark = MKPlacemark(coordinate: self.coordinate,addressDictionary: addressDict) let mAPItem = MKMAPItem(placemark: placemark) mAPItem.name = self.Title return mAPItem}
请帮忙.
解决方法@H_403_12@ 您需要将您的字幕转换为AnyObject,如下所示:let addressDict = [String(kABPersonAddressstreetKey): self.subTitle as! AnyObject]
您的完整代码将是:
func mAPItem() -> MKMAPItem { let addressDict = [String(kABPersonAddressstreetKey): self.subTitle as! AnyObject] let placemark = MKPlacemark(coordinate: self.coordinate,addressDictionary: addressDict) let mAPItem = MKMAPItem(placemark: placemark) mAPItem.name = self.Title return mAPItem }总结
以上是内存溢出为你收集整理的ios – 不能将'[String:String?]’类型的值转换为预期的参数类型'[String:AnyObject?]’全部内容,希望文章能够帮你解决ios – 不能将'[String:String?]’类型的值转换为预期的参数类型'[String:AnyObject?]’所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)