The document “Main.Storyboard” could not be opened. Unrecognized file content in Xcode 8 - xcode8

The Story board is not opening as an interface builder.Please tell me any solution.Thanks in Advance.

The only thing that worked was to create a new storyboard file, open the old and the new storyboards as source code (right click -> open as), and copy the xml from the old to the new storyboard. I didn't take the whole xml, just the scope of the <scenes> </scenes>

Related

Cocoa failed to load window nib file when nib is localized

I'm trying to create and show new window in my simple Cocoa application:
myWindow = [[MyWindowController alloc] initWithWindowNibName:#"MyWindow" owner:self];
[myWindow showWindow:self];
It's working well with basic nib file without localization, but as soon as I turn on localization for this specific nib file (using Xcode "localize" option available form file inspector), the application gives me this error when executing the code above:
-[MyWindowController loadWindow]: failed to load window nib file 'AuthWindow'.
Should I change the way I'm initializing my window controller when using localized nibs? It fails only when nib containing a window is localized (with just one language - English), when there is no localization configured - the window is loaded and appears on the screen as it should. I can't find the right answer, I'm new to Cocoa on OSX, but have some experience with CocoaTouch and developing for iOS.
I restarted Xcode and the error went away...
I don't know... but whatever...
initWithWindowNibName: can locate a .nib file in a localization directory such as en.lproj/. The problem is, sometimes Xcode forgets to compile a .xib file (an Interface Builder file in XML format, which you usually play with) into a .nib file, or a binary format - especially when the .xib file is just localized by clicking "Localized..." button.
If you open $build_dir/Your.app/Contents/Resources/$locale.lproj you will find some xibs only copied from the source directory.
Relaunching Xcode will resolve the situation, while I'm not sure what the cause is and why relaunching does the trick.
It's an old question, but I found a different solution than those above. In the nib in question, go to the identity panel and make sure the nib's target membership is checked.
I had an error like this. What solved it for me was to make a backup copy of the xib file, delete it from xcode, restart xcode, then add it back. Go figure...

XCode deployment error: 'NSInvalidArgumentException', Could not find a storyboard named 'MainStoryboard'

Like many of the prior 'MainStoryboard missing in NSBundle' questions, I've got the same prompt but have found no issue with naming and no issue with if the storyboard exists within an area XCode likes.
All the pointers lead to the same file, I've changed my .plist a good 5 times to make it responsive to the same call as found in Build Stages. Now I'm all kinds of tired of this crap because I just want to program, not debug compiler screw ups.
It happened in an instant and now I've been a day and a half without an interface that works. How should I proceed?
I got the following similar error in XCode 4.3.3:
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: 'Could not find a storyboard
named 'MainStoryboard'
I fixed it by doing the following:
Make sure your -info.plist has Main story board file based name = MainStoryboard
Right Click on your Story Board file in Xcode and select Delete then References Only
Right Click on your project and select Add Files to [Your Project]
Navigate to the story board file, found in the en.lproj folder in your projects directory and add it
Clean, Recompile and Run and you should find it works.
Got the idea from this SO post: XCode 4.2 MainStoryBoard Not Found
Just as a reference to other first timers like me reading through all the SO questions about missing storyboards:
Don't put ".storyboard" at the end of your file name in your plist file. It should look like this:
Main storyboard file base name: MainStoryBoard
When you create a new *.storyboard file, Xcode (version to date) doesn't automatically add it into your build resources. To fix this you must add the file under "Copy Bundle Resources".
Select the Xcode project icon and navigate to: Targets > Build Phases > Copy Bundle Resources
Click the + button at the bottom to add the storyboard file.
After cleaning my Projekt i have every time this Problem......
My solution is:
move the Main.Storyboard intro trash.
Then "Add Files" select your soryboard, after moving the Main.stpryboard from trash zo your desktop.
and, voila. The Error ist gone.
Considering that there is not too much information about your problem, My best bet would be to go to the package Info, and see if the Main Storyboard is set to whatever your main storyboard is.
As of iOS 9 use just "Main" for storyboard name, worked for me.
Ralph Willgoss's steps didn't work for me. I managed to solve it by copying all the viewcontrollers in the storyboard, deleting it (Move to Trash, not Remove Reference), making a new one (rightclicking the project folder and clicking New File, selecting Storyboard) with the same name as the one I deleted and then pasting the copied contents into it.

How do I implement a static library from libPusher in Objective-C (Xcode 4.2)?

Please show me how I can add and implement the libPusher library to my Objective-C iOS project
This is my first post on StackOverflow
I've just started working in Objective-C iOS app development for a company that I co-founded with a couple of colleagues. Our first app needs to have the libPusher library implemented in its porject. Right now, I'm at a crossroads completing the following task of adding and implementing it on Xcode 4.2:
Simply copy libPusher-combined.a and the contents of the headers directory into your Xcode project..
Source: http://github.com/lukeredpath/libPusher/wiki/Adding-libPusher-to-your-project
What does it mean by "copy"ing those files, and where should it be copied to? Can anybody who has experience with libPusher give me specific details as a list and source code on how to execute this so I can understand it better? I would truly appreciated any help, it will get our company up and running for us getting our app functioning and ready for reviewing submission to Apple Developer staff. The link I've provided will tell you more on what I'm talking about, if I need to specify anything I'll create a new post. Thanks!
What "copy" means in this context is that you want to drag and drop the .a (library) file and the header files (all the .h files) into your new Xcode project (to be precise: the file inspector is the list of files along the left side of the workspace window).
To copy anything to an Xcode project, find it in the finder, highlight all of the files you want to copy over (or just take the folder it comes in), then drag everything over the Xcode icon in the dock.
If Xcode is full screen (lion), the icon will kind of blink, then enter Mission Control mode, you then hold the files over the correct project and drop them into the Xcode file tree.
Make sure that your application is checked as a target for those files!!
If Xcode is not full screen, just drag the files or folder into the Xcode file tree and they will be added.
To link to a static library, just navigate to the name of your project>Info>Framworks. Click the plus, then select your framework if it isn't already there.

There is no .xib file when I create a new "Empty Application" in XCode

I am working through the Big Nerd Ranch Guide (2nd Ed) for iOS Programming using Xcode version 4.2.
For the very first project I'm asked to create a new project which is a "Window-based Application" the description for which reads "This template provides a starting point for any application. It provides just an application delegate and a window". The "Window-based Application" option was not available to me in XCode 4.2 but I did see the option to create a "New Empty Application" which has the same description ("This template provides a starting point for any application. It provides just an application delegate and a window")
When I create the project I'm supposed to have a MainWindow.xib file but that does not show up at all in my project? Help please
When you create the project, don't forget to uncheck the option "storyboard". Once you uncheck it, you can see the xib files.
I am using the same book, had the same problem but I figured how to fix it.
Create a new xib file by
right click Quiz folder -> New File -> iOS -> User Interface -> Window -> click Next
click the Window.xib file then find an Object and drag it under Objects -> select the third tab on the right -> change this class to AppDelegate
click File's Owner -> change this class to UIApplication -> click the 6th tab and connect delegate to Window
goto AppDelegate.h and put IBOutlet in front of UIWindow *window;
goto Window.xib again and connect window under Outlets to Window.
Also in plist file add a row
key - Main nib file base name
type - string
value - mainwindow
Hope this helps.
If you create a empty project and do want to use storyboading, then do:
create empty project
add new file (storyboard)
make sure to add a correct entry in your app-info.plist file. (Just create a simple project with storyboard and look-up the key there in the app-plist).
throw a view controller on the board, and off you go.
Like this you have a nice clean project, with the use of the storyboard feature.
Please read this in the official Forum to the Book. BNR posted a project that you can use as your default Project for all Chapters in this Book. They created a small Project that looks as if you created an empty project with the XCode version before iOS5 was released.
http://forums.bignerdranch.com/viewtopic.php?f=74&t=1817
regards
Thomas
You can also create a MainWindow.xib afterwards:
File > New > File >
There should be a Window.xib. If not, creat an empty .XIB file and drag a window (UIWindow) into your Objects pane. Copy the connections as they are displayed in the book.
Hope that helps.
PS.:I recommend to not use beta software to start with iOS

Interface Builder menus "save" and "save as" disabled

in my xcode project, which is based an persistentDocument, the "save" options are not longer choosable. I've checked the connection to first responder. Everything seems right. When I do some work (data entry) and close the app. The app is asking me, if I want to save. But I just can't choose save from the file menu.
Thank you in advance
KD
I've found the solution myself. I had to connect the application object of the interface builder to the files owner as delegate.
KD