Drew
Drew

Reputation: 1777

Access to enclosing/parent NSDictionary of an object

Is there any method I can send to an object, which will return an enclosing collection (NSDictionary/NSArray)? Or a method which would return a collection of all the objects with a retain call on the object in question?

DJS.

@bburn: It possibly is a design problem. I'm trying to parse an XML document, and more or less convert the entire xml tree into a nested NSDictionary tree. I am building a class which I will use many times over in different projects, but the XML source is always the same, thus I want to save myself some repeated work and have it spit out a cocoa "native" data structure, rather than an NSXML/Document object.

I thought I needed to know the parent to help gain context of where I am in the parsing process. Currently using NSXMLParser with a delegate object.

Upvotes: 0

Views: 195

Answers (1)

bbum
bbum

Reputation: 162722

Nope. You can't do that.

Outside of debugging, needing to do this is indicative of a design problem in your code. Why do you need to do this?

Upvotes: 2

Related Questions