Submit app to App Store, storyboard contains invalid file name - ios

Im getting this explanation when my app is rejected by Apple:
Invalid File Name - Your package contains a file 'XXXX.app/en.lproj/MainStoryboard.storyboardc/.nib' with a name that contains invalid characters. Avoid using control characters in the file names. Also avoid leading or trailing whitespace characters in the file names.
What is this .nib file and how do i resolve this error?
I did cd into the MainStoryboard.storyboardc folder and there was a file ?.nib, but when i press cat <tab> i have to type ^V.nib.

I can confirm that #PPCC's answer worked. I had some trouble finding the folder though so I want to share that here. The easiest I think to find it is to go to the derived data for your project. In Xcode, go to Window->Projects and then you can see where the derived data resides for your project.
So my .nib file was located in /Build/Products/Debug-iphoneos/.app/.storyboardc
There I found a file with name "??.nib". I used the "cat" command to open it in command line and then scanned the information in there for the viewcontroller that the .nib file belonged to. I then deleted that viewcontroller from the storyboard and created it again. I made sure to specify a storyboard id. Then I cleaned the project and rebuilt it. It didn't create that .nib file again and I had no problems afterward.
Hope this helps someone.

I ended up rebuilding my entire story-board. Thankfully i had my classes intact so it only took about 15 minutes

I had the same problem and I didn't want to remake all the storyboard file again because it was very hard.
Finally I solved it like below:
The problem was there was a file named ".nib" inside a directory that is automatically created "myAppName.app/MainStoryboard_iPhone.storyboardc".
It's supposed that, when compiling the app, this directory is automatically created and inside there, a lot of files are created related to all the views included inside my storyboard.
The file ".nib" is difficult to find because the MacOs thinks it's a hidden file because it starts with a point.
After being able to open the .nib file I saw it was like an xml file and I recognized the storyboard identifier of one of my views that where on my storyboard.
After that I delete the .nib file and I delete the view inside my storyboard as well. After re-compiling the app the file .nib wasn't created.
So, I added another view to my storyboard and re-designed it like it previously was, and put the same storyboard identifier as well. Only one view.
After that the app compiled well, the .nib file wasn't created, and the app has passed the Apple first revision (now it's waiting for review).
So, there's a bug, maybe in XCode, that creates a .nib file of some storyboard views by error.
I hope this could help in the future if someone has the same problem.

I believe I might have solved mine by removing 'compile with bitcode' option. Further testing required

As an addition to all the other answers: In my case there was a 'storyboardIdentifier' in the storyboard file with a newline. Removing this identifier fixed the problem.

Related

Xcode says Infoplist.strings already exists when I import localizations

So I have a Xcode project and I've added a language for localization. I exported the xliff file, added the translation and imported it back into Xcode. Everything works fine.
Then, at a later point, I've added new strings so I need to update the translation. I repeat the process but when I import the localization now I get the following error message:
“InfoPlist.strings” couldn’t be moved to “nb.lproj” because an item
with the same name already exists.
The localization is not updated. Anyone know what's causing this? I tried to move InfoPlist.strings out of the nb.lproj directory but it didnt make any difference and no new InfoPlist.strings file was created.
Why cant Xcode just overwrite the file if it needs to be replaced?
Hopefully you already solved this, but I had the same problem; maybe this will help someone.
Ultimately, I used find . -name "InfoPlist.strings" in the workspace directory, and found that there were two other InfoPList.strings in addition to the one I had deleted.
Once I deleted them, my import worked again.
You probably just deleted the reference from Xcode. Go to the actual location of the file that you want to delete. In other words the location in finder. If the file is still there then manually delete it.
I came across some weird behaviour with localisation files a while back where Xcode would not ask if I wanted to delete the file reference or send to trash, it would just 'delete'. Later found out it was only deleting the reference in Xcode.

Xcode doesn't autobuild new files

I am trying to add a new class to my project on xcode.
The problem is that xcode doesn't auto complete anything when typing in that class, auto build anything or anything else for that matter.
When ignoring the auto complete, and typing myself, I later try to link my xib file to my class by "pulling the strings" and when I hit enter I get the notorious error message in red saying "could not insert outlet - could not find any information on class..."
I have tried deleting the Derived Data folder, restart xcode, deleting the files of the class I was trying to add, etc. Nothing worked.
What do I do?
I think I have an issue with linking - if I try to add the interface for the xib file, which I created to have a custom table row view, in an existing file already in the project, it all works wonders.
Any one see that problem before?
Thanks!
Choose the m file in your left panel, then choose the target in the right panel.If you already add the file to the target, then in your project build settings, set the search path to your folders. May be the folder that files locate is not the real file filer, it is just a group.

Xcode 6.1 keeps telling me some PartialInfo.plist couldn't be opened

After I upgraded to Xcode 6.1, it kept throwing this exception when I tried to build my existing application. I tried to remove 'MyController' and add back again. But it would throw the same exception with different controller.
could not read data from '/Users/macbookpro/Library/Developer/Xcode/DerivedData/MyApp-
dmhwkhbfbxprhycwjeunwtbbtsxj/Build/Intermediates/MyApp.build/DEV-iphoneos/MyApp.build/MyController-
PartialInfo.plist': The file “MyController-PartialInfo.plist” couldn’t be opened because there is no
such file.
I found the answer. I have to replace all xib files' IBCocoaTouchPlugin to newer version.
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
You can solve it by deleting the content in the DerivedData folder. If you're worried about deleting too many folders, then delete only the folders that start with the name of your current project that you're trying to problem-solve for.
Remember to close XCode before you delete the data
Library/Developer/Xcode/DerivedData/
For me (with Xcode 6.3) this was happening with a file that happened to end in ~iPhone.xib. I changed it end in the all lower-case ~iphone.xib, and problem solved.
This is generally happens when you open old version xibs
nothing to do only click on the xib in file panel its version will automatically changed/updated with newer version.
so also you not need to remember it.
I encountered this problem when I moved my .plist file to a new folder. You have to go into the Targets list (select the top bar on the left vertical menu of Xcode, the one that has the name of your project, and then select Targets on the vertical menu second from the left) and find the Identity section. From there, select the button that lets you specify the new path of the .plist file.
If that doesn't work, then try deleting your project's folder in ~/Library/Developer/Xcode/DerivedData/ and building again.
Several of you have come up with the partial answer.
I believe this issue is related to Apple's "fix" for when XIBs were loading slowly when they referenced custom fonts. They now store the custom font info in a xibnamePartialInfo.plist file in your derivedData folder.
Now if your app contains xibname~iPhone.xib AND xibname.xib, only the PartialInfo.plist file for xibname~iPhone.xib gets created and you see the error. Opening the xib in InterfaceBuilder had the side-effect of creating this file which is why the problem appeared to go away (until the next clean).
So the solution is to rename all ~iPhone files to something else (dash works as a replacement for tilde). Apparently its the tilde that is hindering the creation of the PartialInfo.plist file for the root XIB
Common answer for most of question... Restart Xcode. It works for me.

Problems with localization of .storyboard files

Trying to make my project using storyboard.
I changed my info.plist and added entry UIMainStoryboardFile with the name of my storyboard file and other things from documentation. I added new storyboard-file to my project (it was created in Xcode 4.1 and now I'm working with it on 4.2), made interface that i need and decided to localize it.
After adding localizations for it in File Inspector and localizing each file, I don't see any changes when I run the app. Even if i change all localized files, I still see app like it looked before adding localizations in File Inspector. I tried to delete this file and create a new one with another name, but the result was always the same.
When I create a new empty project and do the same thing everything works fine. Or when I remove all localizations for my storyboard-file, everything works too.
What can I do to fix it? What did i miss?
Thanks.
Had the same problem. Solved it by doing a clean, deleting all derived data in filesystem (~/Library/Developer/Xcode/Derived Data) and deleting the App from Simulator.

How to rename an xib file in Xcode 4?

I renamed an xib file in Xcode4, just by highlighting in the project organizer and changing the name, but it seems to confuse the project. For example, if I add a new button to the view, it doesn't show up when I run the project. However, if I rename it back to the original name, it shows up. What's the correct way to rename an xib file?
Xcode can sometimes be very picky with name-changed XIBs; the way that works best for me is as follows:
Remove the reference to a XIB file from my open project
In Finder, rename the file(s)
Drag them back to the project
You may still encounter errors either side of this process - and on other occasions, renaming the file by a (slow) double click on said file will work.... for errors like these, I find that by going Project -> Clean will also help.
Keep us posted!
What I've done and worked like a charm is
dereference it from you project but not delete the files
Open .xib with a text editor and rename the class
Drag drop to project again
and voila!
I know sounds a little bit awkward but that'life. If someone else has something better please say it...
I had a much bigger problem in that I was renaming a project which also required that I rename a xib. This is by no means easy. My final problem was after renaming the xib the class no longer matched because the old class was still named in the renamed xib file. I took Martijn's advice and simply edited the xib file with a text editor and renamed the class. Then I had to dereference and re-reference the xib. That did the trick.
I know it is already answered though i need to add one more thing i have faced to ...
I tried to rename MainWindow.xib to Window.xib from context menu of XCode, then i changed "Main interface" setting to relevant XIB in PLIST file ... from that time whenever i was running my App i saw SIGABRT error (Product > Clean did not help, unfortunately) ... until i completely closed and reopned me VMWare.
So in case you use Virtual Machine then it is + 1 more suggestion to answer above - RESTART your VM.
Hope this helps ...
First close Xcode, and make a backup of your project folder. Then move into your project folder and rename every file and folder which contains OldName so that it now contains NewName instead.
In the project folder, run following command in a terminal, to update the contents of the files in the project:
find . -type f -exec sed -i 's/OldName/NewName/g' "{}" \;
Open the now-renamed project in Xcode and clicked Build -> Clean All Targets.
After that, the project (with the new name) will be built successfully.

Resources