//.h file @property (nonatomic) IBOutlet AGSMapView *mapView; @property (nonatomic, strong) AGSEnvelope *mapExtent; //.m file NSString *kMapExtent = @"mapExtent"; AGSPolygon *mapExtentPoly = self.mapView.visibleArea; // see above...self.mapExtent is of type AGSEnvelope self.mapExtent = mapExtentPoly.envelope; // this is key to the problem...attempt to convert AGSEnvelope so it can be used as NSData in NSUserDefaults. self.dataForMapExtent = [NSKeyedArchiver archivedDataWithRootObject:self.mapExtent]; // the program crashes after this line is run NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:self.dataForMapExtent forKey:kMapExtent]; [defaults synchronize];
[AGSEnvelope encodeWithCoder:]: unrecognized selector sent to instance
Solved! Go to Solution.