Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' in Xcode 11 - xcode11

Cannot initiate Main.storybard as the first screen.
Question:
Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?
Workdone:
I tried to set the Main.storyboard as the initial view controller.
In the Info.plist, I also set the Launch screen interface file base name as Main
Result:
Nothing change. Problem still there.
Image:
Storyboard attribute setting
Info.plist setting

have you tried creating a new view controller and setting it as the initial view controller? I think it "jumpstarts" the project. Worked for me

Related

No need for ViewModelLocator if using RegisterForNavigation?

In prism we can have ViewModelLocator resolve the VM when we navigate to a View by setting the attached property prism:ViewModelLocator.AutowireViewModel="True"
However, in the PRISM samples on Github, the container is initialized using the extension method (RegisterForNavigation) which seems to do the same thing.... ,
containerRegistry.RegisterForNavigation<MainPage, MainPageViewModel>();
I am wondering if the RegisterForNavigation has made the AutowireViewModel attached property approach obsolete?
I am wondering if the RegisterForNavigation has made the AutowireViewModel attached property approach obsolete?
No, this kind of registration just - additionally - defines the view model to be used for the registered view directly (instead of relying on the convention configured in the view model locator).
Setting ViewModelLocator.AutowireViewModel is still required to actually create the view model (whether it's type is defined manually or derived from the view's type by a convention).

Exception while running ibtool: Cannot find value transformer with name

I just upgraded Xcode to 8.0 (8A218a) and am converting my project in Swift 2.3 to Swift 3.0. The only issue left now is this error:
"Exception while running ibtool: Cannot find value transformer with
name UTIToIconTransformer"
The UTIToIconTransformer is defined something like:
#objc(UTIToIconTransformer) class UTIToIconTransformer : ValueTransformer {
// ...
}
The code worked fine when it was in Swift 2.3. The binding using this value transformer is set like this:
If I remove this binding, the app runs, and the row titles are shown correctly.
I have tried calling NSValueTransformer.setValueTransformer() in the app delegate's +initialize(), in applicationDidFinishLaunching and in the value transformer's +initialize(), as suggested here, here at StackOverflow and here at NShipster (Though I don't think the statement of "Typically, the singleton instance would be registered in the +initialize method of the value transformer subclass, so it could be used without further setup." complies with the Apple's doc.), all without success.
In the Apple's doc, it says
Value transformers are typically registered by an application’s delegate
class, in response to receiving a initialize: class message. This allows
registration to occur early in the application startup process, providing
access to the value transformers as nib files load.
Availability in Interface Builder
Your NSValueTransformer subclasses are not automatically listed in the
Interface Builder bindings inspector. When inspecting a binding you can enter
the name that the value transformer is registered with, but the functionality
will not be present in Interface Builder’s test mode. When your application
is compiled and run the transformer will be used.
But registering in the AppDelegate's override class func initialize() didn't help. In Xcode 7 and Swift 2.3, it even worked without the registration.
Finally I solved the problem by removing the NSOutlineView from the storyboard and setting up a new one.
I have another project which also has an outlineview binded with an NSTreeController, and that project has no problem after the Xcode 8.0 upgrade. Then I tried creating a new ValueTransformer with a new name, with no luck.
I guess there may be something wrong with the storyboard, so I tried recreating the outline view. Then Xcode doesn't complain that it can't find the transformers!

What is causing the compile error: Illegal NSTableView data source?

After some 'cleaning' of a working app, the main window appears as designed in the MainWindow.xib.
I deleted a MainWindowViewController object in IB. (was beneath Font Manager)
MainWindow.xib has it's Custom class set to MainWindowViewController
The table uses Content Mode - View Based
The two required methods ARE included in that implementation file
included in header file
Table view connection has been made to File's Owner
EDIT: Does the full error message give a clue? Why the NSApplication?
*** Illegal NSTableView data source (<NSApplication: 0x100607ad0>).
What am I missing? What should I check to resolve?
Image included to help visualize.
EDIT 2: (New info)
I deleted the data source & delegate connection from the table view and the error disappeared. The same IB designed window opens with an empty table view.
My 'project' is more complicated than the documentation covers. How to add a Window Controller to the Cocoa/Core Data template and utilize this controller is not easily found.
The most pronounced symptom was that the code in the intended controller was not being executed. The 2 required delegate methods were present. awakeFromNib wasn't being called either.
After more research, it appears the 'missing link' is the (previously deleted) NSObject set to the custom class of MainWindowViewController or MainWindowController in the nib file. I'm still looking for why this needs to be or why connecting to the File's Owner doesn't make the connection.
On the one hand, we can set the File's Owner to the custom class (MainWindow)ViewController or (Main)WindowController and connect the contained views to File's Owner. This doesn't work as I expected.
On the other hand, (apparently correct) we can add an NSObject to the MainMenu.xib file, set it's custom class to the (MainWindow)ViewController or (Main)WindowController and then connect outlets to the subviews to this object. The step of adding this object in IB is the only way I could find of connecting the window to the controller.

Quartz Composer "Binding Controls to Input Ports" in Xcode 4.x

I am trying to follow "Binding Controls to Input Ports" of Quartz Composer Programming Guide.
The document says :
5.Click “Bind to” and then choose Patch Controller in the “Bind to” popup menu.
6.Enter patch in the Controller Key text field.
7.Enter text.value in the Model Key Path text field.
In my project of Xcode (4.2 &) 4.3, the Controller Key text field is disabled. The Model Key Path text field requires an object of QCPatch class, which I don't think I have a clue.
Should I install Xcode 3.x and handle this & convert to 4.x? Any advice ?
I am experiencing the same issues, however via the kineme forums I have found a work around:
using the Object Controller instead of the Qc Patch Controller:
make a new cocoa project...
add quartz framework via buid phases tab and import the framework to your project either in the pre compile header, or app delegate...
add qc view to your xib and load your composition
add object controller to your xib...
change object controllers class to "QCView" without quotes.
control drag your object controller to your qc view and select "content"
add a slider and bind its value to your object controller and set its model key path to "patch.Text.value" without quotes.....
see this for the full thread on this topic.
in xib file choose the QCView
Attibutes Inspector -> check "Forwards All Events"
hope it helps

View outlet not available to File's Owner

I was getting the following message upon creating a new view controller. Everything was compiling a-okay in Xcode without errors, but the app was immediately quitting upon loading the new view from a RootViewController.
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "HomeView" nib but the view outlet was not set.'
To resolve this, I tried connecting the File's Owner to the view, but the view outlet wasn't even available to the File's owner.
Moved from question section, per #Tim Post's suggestion.
Discovery:
I finally realized that when I added this View XIB, the File's Owner had been set to NSObject instead of HomeViewController (my newly-created view controller). Once I set the class identity in the indentity inspector, the view outlet was then ready to be connected to the view.
The app now loads and the new view loads perfectly. Just sharing for the benefit of the SO community.
Conclusion:
When creating a new View XIB, make sure to set the class identity to the desired view controller in the indentity inspector (Cmd+4). It may be set to NSObject by default.
The view outlet should then be available.

Resources