Refactoring breaks because VC's initWithNibName:: uses an argument
| Originator: | khakionion | ||
| Number: | rdar://13160227 | Date Originated: | 05-Feb-2013 |
| Status: | Open | Resolved: | |
| Product: | Xcode | Product Version: | 4.6 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary: Creating a new iOS app from the single-view Xcode template makes a UIViewController subclass, XXViewController, where XX is the class prefix. This is usually not a good name for the root view controller, so it's likely the Refactor function would be used to change that class name. However, in the App delegate, the VC's initWithNibName:: is called by specifying an NSString for the nib file name. This NSString literal is not refactored, so the app crashes on startup when it can't find the old-named nib for that VC. Steps to Reproduce: Create a new Single View iOS App. From the "Refactor" menu, change the name of the root view controller. Expected Results: A buildable app that does not have any regressions due to the class name change. Actual Results: The app crashes on startup. Regression: Unknown. Notes: Please simply change the "NibName" argument to nil, then the refactored code will work because the default behavior is to look for a xib that matches the class name.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!