• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Renaming an App Delegate in an XIB file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaming an App Delegate in an XIB file


  • Subject: Re: Renaming an App Delegate in an XIB file
  • From: Alex Zavatone <email@hidden>
  • Date: Fri, 23 Mar 2012 11:47:57 -0400

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


- Alex Zavatone



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Renaming an App Delegate in an XIB file
      • From: Christiaan Hofman <email@hidden>
References: 
 >Renaming an App Delegate in an XIB file (From: Alex Zavatone <email@hidden>)
 >Re: Renaming an App Delegate in an XIB file (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Xcode 4.3.2 crashing in search-replace
  • Next by Date: Re: Here's a new idea... or maybe a really old one revisited
  • Previous by thread: Re: Renaming an App Delegate in an XIB file
  • Next by thread: Re: Renaming an App Delegate in an XIB file
  • Index(es):
    • Date
    • Thread