When the XIB is selected, and you click on your window, you'll see Placeholders, File's Owner, First Responder, Objects, App Delegate, Window...
I had duplicated a project where I had items set up properly and changed the name of my AppDelegate .h and .m files and the name of the @Interface in each to be more appropriate to the project.
Of course, when I ran this iOS app in the simulator, it failed right away. Teh Googles told me the relationship I needed to understand that that my App Delegate in the xib file also had to be renamed.
That was what I was trying to do. Change the name of the App Delegate from the old one to the new one in the interface editor for xib files.
It doesn't let you. At least not as far as I can tell. I ended opening up the xib in an XML editor and did a search and replace.
Also, it turns out that if you have renamed your project using Xcode, as of Xcode 4.2, the IBDoument.LastKnownRelativeProjectPath in all your xib files is never updated. That might cause problems somehow eventually.
Here's the string at the end of the xib XML file <string key="IBDocument.LastKnownRelativeProjectPath">DamnOldFileName.xcodeproj</string>
On Mar 23, 2012, at 11:29 AM, Fritz Anderson wrote: On 23 Mar 2012, at 9:46 AM, Alex Zavatone wrote: Is this even possible without opening the XML?
Not clear what "renaming" means. I assume you mean changing the class, and not the convenience display label for the XIB.
Select the delegate object (if you put it in that way), or File's Owner (if it's in that way), go to the Identity (third) inspector, and edit the first field you see.
If you want to rename the class everywhere, select its name in source code, and then Edit > Refactor > Rename…. In earlier Xcodes, this didn't reach XIBs, but that bug is now fixed.
— F
|