objective c - Sending 'MKPointAnnotation *__strong' to parameter of incompatible type 'id<NSCoping>' -


I have a MKMapView in this view I made some comments When the user clicks the Annotation Disclosure button, I want to push to see in detail.

When I make annotations, I still have the key to store item to be able to fill the NSMutableDictionary.

Mkpoint Annotations * Point = [[Mk Point Annotation Elok] Init]; CLLocationCoordinate2D AnnotationCoulder; Annotation Cord.Latitude [[Store Store Latitude] Float Value]; Annotation code. Langlit = [[store store longitated] float value]; Point.coordinate = annotationCoord; NSString * title = [store storeName]; Point.title = Title; Point.subtitle = Location; // Refer to the object to store the object with the annotation point as [Key] [AnnotationStoreEcturation Set Object: store forKey: point];

When the user chooses annotation, I want to call DetailViewController and pass the object:

  - (zero) mapView: (MKMapView *) MapView AnnotationView: (MKNotationview *) Visual CalloutExecution Controls: (UIC Control *) Control {DetailsviewControlerCon = [StoryboardInstitutionalView Controller With Identifier: @ "DefenseView Controller"]; Store * Store = [Annotation Store Object Folder: View.notation]; Con.store = Store; [[Self-Navigation Controller] Push ViewController: With Animated: Yes]; }  

The problem is that MKPoint annotations do not conform to the NSCoping protocol, it says:

  incompatible type 'id & lt; NSCoping & gt; Sending 'mkpoint annotation * __ robust' for the parameter  

How can this be fixed?

You can not do something like that in the dictionary as a key NSCopying < / Code> does not conform to the protocol. You have to do anything that does this.

One way to get around this is to create subclass of MKPoint Annotation with the additional properties of correlation - and in that case, you also have additional properties or properties Can also be used and can not go through the dictionary in the first place.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -