Can't create iPad XIB with Xcode 4 - xcode

Alright, I have a problem on my hands. I'm trying to convert my project to a universal app for the iPhone and the iPad. I'm trying to make iPad-specific versions of my XIB files. As it's not possible to Create iPad version using autoresizing masks in Xcode 4, I assumed I'd just be able to pop my XIB into Xcode 3's version of IB, and let that do the magic. No dice. Here's the error I get when i try to open the XIB file in IB:
To be honest I don't know where to proceed from here. I guess I could just resize my views manually, but that's quite tedious and I don't really have the time to be doing that. Any ideas?

Alright, I figured out a rather convoluted workaround.
First of all, duplicate your original project and then select your project info. Right-click on your target, and select "Duplicate".
Xcode will then pop up this message. Select "Duplicate and Transition to iPad".
Now Xcode converts the XIB files for you, and presents you with an iPad resources folder.
Now open these XIB files in the Finder, and append ~ipad after the file name.
After doing so, copy these XIB files back into your original project, and then turn your project into a universal project by selecting from the dropdown in your target settings.
And you're done. I found that really convoluted, and I'm hoping Apple can fix this huge usability problem soon.

This should not happen. One way to fix this problem would be t completely remove the Xcode 4 Installation and re install it from scratch . And then re install it.
Use the following command to uninstall and re install Xcode 4
sudo [xcode-path]/Library/uninstall-devtools --mode=all
PS: If you are creating projects in Xcode 4 that you also want to open in Xcode 3 make sure you keep Document Versioning section to Interface Builder 3.1

Related

Interface builder storyboard compiler error Xcode

I downloaded Xcode and am getting "Interface builder Storyboard Compiler Error" when I try and run any project.
So far to troubleshoot this I have(based off any similar threads):
-cleaned the file
-created a new blank file (which still gives the compiler error message)
-uninstalled and reinstalled Xcode (Version 8.2.1)
-tried installing Xcode 8.3 beta 5 (still gives me the same error)
so far nothing has fixed this error.
Also I'm up to date on OS, running macOS Sierra version 10.12.3
I am learning swift for work and am hoping to get this figured out soon.
Thank you!
Xcode 8.2.1:
quit Xcode
delete .xcuserdatad folder inside xcuserdata of .xcworkspace(if using Cocoapods) or .xcodeproj
reopen Xcode, clean project and clean build folder (Under Product option)
That should be ok!
I had the same problem while trying to archive my app for the app store. I tried twice and same problem occurs.
Then i deleted the derived data, cleaned the project and restarted Xcode - THAT FIXED it.
Hopefully this will help someone else
I Solved the problem by cleaning the build folder.
Just use cmd + option + shift + k and then build the project by using cmd + B and hopefully solve the problem.
I was having this error for xCode 9.
An .xib file was creating the error.
What I did was,
removed .xib file
added it back to the project
cleaned and built the project
That solved my problem.
I also ran into this with XCode 9 Beta - 2, the quick nuke from orbit didn't fix it. Just check out the Log file it points you to and you can at least patch the offending issue, even if it a bug on Apple's end. For me, the TabBar didn't like an icon image, removed it for now and it Built fine.
I'll try replacing it yet with another image. Apparently it doesn't like its own System-provided Images.
Exception name: NSInvalidArgumentException
Exception reason: System-provided UIImage instances cannot be encoded
in NIBs - raised for instance '<UIImage: 0x7fd377eb4510>, {18, 20}'
None of the above suggestions worked for me. After further research I found that I had dragged a segue (popover) from a button inside of a tableview cell.
This is not allowed, as the touch anchor screen location is dynamic while the table scrolls.
I fixed the problem by anchoring the whole tableview instead and programmatically altering the popover arrow placement to be in line with the cell's button.
I just had the same problem.
After systematically removing objects from the xib I found that a button which was disabled and hidden created the internal error. After removing the button it works. (I tried to set the button back to normal : visible and enabled but that was not sifficient).
Hope that help you.
I have filed a bug report.
I have solved this issue by following below steps:
1. cmd + shift + k
2. cmd + option + shift + k
3. Restart Xcode
4. Restart you mac.
Hope this will also help you. Thanks!
I had this same error after updating to xcode 9.4. After doing a Product -> Clean and then Product -> Build still no luck. Then Done a clean again and restarted. After the reboot the build succeeded.
I use Xcode 9.4.1 and Xcode 10 beta 4 on macOS 10.14 beta 4. I opened the project that threw this error in both versions of Xcode.
While removing different files from bundle resources, I also got several other errors, such as "Interface builder XIB Compiler Error" and "Failed to launch IBCocoaTouchImageCatalogTool via CoreSimulator spawn".
After trying every other solution I could find, what finally worked for me is reinstalling Xcode 9.4.1, reopening the project and cleaning the project/build folder.
I speculate that this happened because there were times when both Xcode versions were open simultaneously. The two versions use common files and the simultaneous usage possibly caused an internal inconsistency in the rendering of Interface Builder.
I had this problem too, in Xcode 11;
In my case it happens after solving conflicts on .xcodeproject during merging code.
I followed below steps:
Remove storyboard from reference of project.
Select MyProject.xcodeproj and show content of that, then open
project.pbxproj by Xcode or text.
Search for storyboard name and removed all line contains that names.
Build project
Add storyboard to project.
Build project again.

Xcode 8 Storyboards Blank

For some reason in Xcode 8.1, all my storyboards are now blank, with boxes around where the content used to be:
I tried cleaning, deleting the Derived Data folder, and changing the size to Freeform but nothing has worked.
How do I fix this?
Try these:
Delete your derived data. Close xcode and clean, build again.
If option 1 not work then, Copy your project to another directory/folder. Close Xcode, open project from new directly and clean, build.

Xcode 4: Custom TableViewController .m file cannot be edited. At all. The content disappears.

So this is just bizarre. If I create a custom Table View Controller as a subclass of UITableViewController, I can't reliably edit the .m file. When I click on it, I can see everything in the file, but I can't actually drop the cursor in to edit the code; it stays fixed in the top-left of the screen. Anything I type will appear, and any code already in .m that happens to be on that line will randomly appear. It's like a static image of the .m contents are on the screen, but the actual text is hidden.
Eventually the entire editor just goes blank. Everything else works fine. I wiped Xcode with app cleaner to pick up all the loose com files, restarted, re-installed Xcode from the dmg and re-created the project and still have the same problem (this is under Mavericks, by the way).
Granted, Xcode 5 doesn't seem to have this issue, but I'm quite new to programming and am following a course that's based on Xcode 4. And at this point the issue is just so stupidly weird that I want to figure out what's going wrong. Any insights?
I've given up. If for some strange reason someone happens on this question and has the same problem, it's not worth the energy; just head to Xcode 5 and live your life bizarre-error free (for now, heh).
I was having the same problem. I just cleaned the Build Folder and everything seems to be working perfectly now. You clean the build folder by selecting Product, hold Alt, and then "Clean Build Folder.
I too had this problem after upgrading to XCode 5, then downloading and installing XCode 4.5 (without removing Xcode 5). What I wound up doing was to create all my new UITableViewController files (File->New File->Objective C Class) as UIViewController files, then modifying the parent class to UITableViewController in the .h file.

The document "XXXX.xib" could not be opened. Could not read archive

After opening my project in the Xcode5 developer preview, errors appeared against a few .xib files when I tried to open the project in Xcode 4.5. The error text was:
The document "XXXX.xib" could not be opened. Could not read archive.
Please use a newer version of Xcode. Consider changing the document's Development Target to preserve compatibility.
The project's development target in Xcode5 appears to be iOS 5.0.
Looking at the source code of the .xib files with errors, it is clear that the .xml structure for .xib files in Xcode5 has changed quite dramatically, and it needs to be reformatted to be backwards compatible.
Is there a way to set development targets for specific .xib files? Does anyone know how this error can be resolved?
Many thanks.
Just open Storyboard in XCode 5, into right panel and "File Inspector" tab do:
edit your "Interface Builder Document" like follow:
Save it and open in previous XCode.
First of all open project with Xcode5. and then
select XXX.xib find Interface Builder Document
Opens in Xcode 4.6(if is 5.0)
close project
open it with 4.6
A better and easier solution that works even if your project isn't under source control can be found here (mine):
Just installed xcode 5 and have missing storyboards
Hope that helps.
It's a current problem when you open your Xcode 4.6 project with the new XCode 5.
To reuse correctly your XIB with Xcode 4.6 :
1 Open your project with XCode 5
2 Select your Xib to restore
3 In the File Inspector Section, in "Interface Builder Document",
select Xcode 4.6 in the Development's version of Document Versioning
4 Build and close
5 Reopen your project with XCode 4.6
It's possible to have some regression with elements width & size in your XIB, but it was restored successfully.
Cheers,
well obviously you created your project prior to the new xcode developer preview. then you tried opening your project with the new DP and boom, it automatically changed everything in your xibs to be able to present your xibs in a higher version. easy to fix. with your xcode 4 ios 6 open the same project, then right click on the name of the xib that is not opening and select source control and from there select discard changes. that should return the xib back to the shape it was before you opened it with the new xcode DP.
let me know if you need more help but that should take care of your problem.
First you have to open your's project with newer version of Xcode.
Right click on XXX.xib file and select "Show File Inspector."
Go to Interface Builder Document.
Change Development option with older version of Xcode.
Once I used to manage a project with XCode 5 xibs in XCode 4. I split xibs for each XCode version and made this build script that compiles xib to nib and place that nib them inside the app
#get SDK version
SDK_VERSION=$(echo $SDKROOT | sed -e 's/.*iPhone\(OS\)*\(Simulator\)*\([0-9]*.[0-9]*\).sdk/\3/')
if [ $SDK_VERSION == '7.0' ]; then
echo 'Current SDK is 7.0'
ibtool --compile ${TARGET_BUILD_DIR}/${TARGET_NAME}.app/output.nib ${PROJECT_DIR}/ProjectFolder/input.xib.xib
echo 'Copied nibs to' ${TARGET_BUILD_DIR}/${TARGET_NAME}.app
else
echo 'Current SDK is not 7.0 (SDK is' $SDK_VERSION')'
fi

iOS5 Storyboard error: Storyboards are unavailable on iOS 4.3 and prior

I've built a small app using storyboards and it ran great. Just before final testing I decided to try it out to see if it runs on iOS 4.3. I clicked on the gray 5.0 in the project settings and selected 4.3.
The app failed to build with the following error message:
Storyboards are unavailable on iOS 4.3 and prior
Both the iPhone and iPad storyboards tell me that.
The issue that when I switched back to iOS5 target, I still keep getting these errors from both storyboards, and the product won't build!
I checked: iOS Deployment target in projects settings is 5.0
Target app deployment target is 5.0
Build settings uses iOS 5.0 SDK
What else do I need to do to restore my project to a buildable state? Is this a brand new bug or am I forgetting something?
Update: I kept getting this error even after doing a clean.
I changed the debugger in Schemes to "LLDB" and did an additional clean, the project now builds and compiles
I also got this problem and finally I solved this by following procedure:
Open XXXXXX.storyboard
Open Identity and Type tab in your right view of Xcode.
Set the value of Development in Document Versioning to "Xcode 4.2" (my default value is "Default Version (Xcode 4.1)".
Change the value of Deployment from Project SDK Version (iOS 5.0) to iOS 5.0, then back to Project SDK Version (iOS 5.0)
Rebuild the project and the error should be resolved.
The solution that worked for me was just to delete the ~/Library/Developer/Xcode/DerivedData directory for my project.
I'm just going to add this one as another possible answer here, as the first solutions worked for me several times (as I mentioned in my previous comment) until today when I couldn't get my project to compile for love nor money with the same error.
With the debugger changed and Xcode set to 4.2 and restarting several times I could not compile. However I discovered another way to get around this issue.
Select the storyboard in the left column and 'Show in Finder' and drag the storyboard to the desktop. Xcode will now change its colour to red and be unable to compile.
Clean the project, drag the storyboard back from the desktop to the directory in finder.
Then, it builds and the error goes away again.
I don't know what triggered the error originally as I'm developing under iOS5 and building for 4.3, but it seems to come up from time to time and.
This seems to be a bug in the latest XCode that I've also run into too, did try the OP's solution of changing debugger and that had no effect.
It cropped up for me since I tried storyboard with 4.3 and then tried to change back.
My solution was to close XCode, open it again and clean. Then I compiled and it worked fine.
Hope this helps others.
While other solutions helped me, they didn't work 100% of the time. I don't know enough about XCode to know how reliable this solution is, but at least it worked for me so you can try it in your project.
In the left hand side of Xcode, open the project navigator. Click the top item, which is your project. In the panel immediately to the right, you'll see a choice to choose between your project and its targets. Click the project, and then in the panel to the right, under the "Info" tab, set "Command-line builds use" to Debug (in my two projects where I was having the error, both were set to Release).
A picture is probably easiest:
Another idea: Open another project with storyboards in Xcode and try to run that. If it succeeds, you can come back to the current project and it should build. I think this clearly indicates a bug in Xcode.
After trying all the answers in here (removing the Storyboard reference, quitting Xcode, cleaning, changing debugger, etc.), none worked (with Xcode 4.5).
The only way I got it to rebuild (and it was a total guess) was to open the Storyboard file in a text editor and delete the following line:
<deployment version="1280" identifier="iOS"/>
It should be near the top of the file, in the <dependencies> section. After that, the project was built successfully and Xcode even re-added that line to the file, but, it still builds...
Go figure...! Hopefully it can help someone!
At last, an elegant workaround that seems to do the trick for me! (I sure hope it works for everyone else. This one's stubborn.)
Once your settings are back safely in iOS 5-land, try Cmd-Option-Shift K (aka "Clean Build Folder..." from the menu - hold down Option to see it), then build.
the solution is simple,
right click your storyboard file, and show in finder
then select the folder where the file is (this would probably be in the en.lproj folder)
right click on the MainStoryboard.storyboard file causing the problem and open with text edit
find the line that reads or something like this:
<development version="4300" defaultVersion="4200" identifier="xcode"/>
and change it to something like this:
<development defaultVersion="4300" identifier="xcode"/>
save the file and build. Et voila...
Ok, I tried everything above and problem still occurred. So I just remove storyboards (as reference not move to trash). then build successfully; after that I added them again; Build, And finally worked.
I was having the same problem. I tried all the above answers and all combinations and nothing worked. Then later after doing some research, I analysed that the simple fact that the error that was throwing at me was straight forward.
Just go to the Build settings and instead of selecting the xcode project file, select the product file and change the Deployment target to 5.0 or 5.1. The error should go off.! I did this in Xcode 4.3 in Lion OSX. It worked fine for me!!
I also had this problem, and nothing helped. Even opening another project and trying to build failed.
What I did, and what for me, was going to project -> info and under "Deployment Target" change iOS Deployment Target to whatever, build and than change back to whatever it was and build again.
Here is yet another random, voodoo, flail that seemed to workaround the bug just now. (after other techniques here had not helped) I renamed the storyboard file (and the entry for it in the info.plist file). Haven't tried the "drag to/from desktop" ritual yet.
Tonight, I have lost like 45 minutes to this issue. grrrrr. Ok I feel better now.
After trying all the suggestions above, without success, I got my code to compile doing the following.
Edit -> Refactor -> Convert to Objective-C ARC
rm -rf $HOME/Library/Application Support/Developer/Shared/Xcode
rm -rf $HOME/Library/Preferences/com.apple.dt.Xcode.*
rm -rf $HOME/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
rm -rf $HOME/Library/Developer/Xcode
seems to help with Xcode 4.3.2
Had similar issue. XCode would build and run other projects fine but couldn't get rid of the error on project I had changed, not even backups from server. Tried all the above solutions but nada. Here is what worked.
Uninstall XCode.
Delete user/library/developer/XCode folder.
Reinstall XCode (maybe you should start this before searching for the folder, download took me 20 minutes).
Start up, clean and build.
Worked for me. Saved me some time. Sometimes when the scalpel doesn't work it's time for the hatchet. Now I get to pick a new font to code in (this will clear your preferences)!
The only solution that has worked for me is to create another project without Storyboarding enabled, build it, then switch back to the storyboard project, clean and build.
Here is yet another random, voodoo, disconnect your iPhone if it is connected.
I simple changed deployment target to 4.0 and Development to 4.3 from MainStroyboard.
I clean the project; and restarted the mac, :) i know it sounds funny but restarting xcode didn't helped. maybe there is a cache in memory...
Then i built the project ; it was ok!

Resources