I'm making a view based quiz app for iPhone with a lot of subjects and categories. Each of the categories consists of a number of questions with alternatives. When you answer correct, you go to the next question. I've now designed an empty subject template where I simply insert the new questions and answers, and that's the files I need to copy and then modify when inserting a new subject. Here is what I've done:
I duplicated all the template files (M, H and XIB) in Finder and changed the file names with Automator.
OldNameViewController
toNewNameViewController
.Then I added the files into the project with "Add existing files".
Next I changed all file names and navigation lin开发者_运维百科ks in the code with Find and replace.
FirstSubjectQuestion1ViewController
toSecondSubjectQuestion1ViewController
.
But here is my problem. Although I've changed all the code, when I open one of the new XIB files and go into Files Owner
, the navigation buttons are still hooked up with the old links, which doesn't even exist anymore in the code. There are hundreds of navigation buttons in my app, all linked in Files Owner
, so I don't want to do it manually.
Anybody? I'm sure the answer is pretty simple, but I just can't find it out.
Instead of just renaming files, you should use the Refactor tool in Xcode 4. It will also fix your xib files and connections.
Yes, copying XIB entities like you did also copies their links (i.e. their "Files Owner" & "First Responder").
@jtbandes has suggested you the way to solve this...
精彩评论