By method, I mean the method names within the class that I'm interested in observing. Not recursively inherited method names.
The reason why I'm interested in this is that Xcode is not letting my code compile if I send a message to an object I get while I'm iterating an array, but I can send that message to an instance of a locally declared version of that object and I'm trying to find out why.
For clarity, I'm getting this error : Automatic Reference Counting Issue: Receiver type 'NSDictionary' for instance message does not declare a method with selector 'returnPropertiesInDict' If I uncomment the last line in the code below:
- (IBAction)saveData:(id)sender { for (NSDictionary * myAnnotation in self.mapView.annotations) { MyLocation *tempLocation = [[MyLocation alloc] init ]; // test that the methods in the MyLocation objects actually work on an empty object NSString *myString = [tempLocation name]; NSDictionary *myDict = [tempLocation returnCoordinatesInDict]; NSDictionary *myStuffDict = [tempLocation returnPropertiesInDict]; // Try it with one of the MyLocation objects in the annotation array // NSDictionary *myGoodsDict = [myAnnotation returnPropertiesInDict];
I thought that adding an accessor method to MyLocation to return all the data (string and a CLLocationCoordinate2D struct) would be the proper way to get all the information I want to save from the mapView's annotation list which contains n instances of the MyLocation class which conforms to <MKAnnotation>.
I'm confused as why the call to the tempLocation works fine, but to myAnnotation (they both are MyLocation instances) causes a compiler error.
On May 9, 2012, at 1:57 PM, Jens Alfke wrote: On May 9, 2012, at 10:40 AM, Alex Zavatone wrote: While po is nice to dump dict data, I seem to remember that there was something to dump the methods of an object. Sadly my googles are failing in this respect. Is there such a wondrous option or were the fumes getting to my brain cell?
Methods are code … how would you dump those? And the listing would be pretty long, because every regular class inherits a jillion methods from NSObject.
If you mean *instance variables* instead, just do “print *object”.
—Jens
|