I’m trying to make a tool that lets me design my GUIs in Interface Builder and then export those GUIs into a XML or plist file for dynamically loading at runtime. I can get all of the various properties I need from UIButtons, UIImages, etc, except for the filenames of the images shown on various elements.
I was wondering if there was any way to get some little-known property from the various UI objects (like the various keys or IDs I see in the nib) and use that to help perform a search through the nib XML to find what I need. For example a given button has “ID” “34567875492”, and I could then search the nib XML for that ID and a nearby filename for an image.
Or, I could use a better way to develop runtime GUIs without WebViews or writing totally-custom XML with no WSIWYG editor… Thanks!
Currently, the structure of a
.xibis like so:You could parse the XML with your favorite parser and pull out the values corresponding to any
UIImageViews and so on to get objects having appropriateclassattributes (likelyUIImageViewandUIButton) and then inspect the nodes underneath them for promising keys. I’d expect with future versions of IB this will change however.