Swift and Storyboard, failed to set contentViewController - swift

Some users of RsyncOSX has experienced an issue on Mojave (10.14.6) with the following error:
Failed to set (contentViewController) user defined inspected property on (NSWindow): must provide an environment dictionary
RsyncOSX is a Swift and Storyboard based macOS app, and I am not able to reproduce the error. It is not a compiler issue, and I dont have any idea what causes the issue. The initial viewcontroller is set in Storyboard, there is no such issue on either 10.15 or 11.00 (Big Sur)..

Related

swiftui Fatal error: attempting to create attribute with no subgraph

Hi whenever i run my ios app in the simulator i get the error Fatal error: attempting to create attribute with no subgraph: CachedView<KFImageRenderer, ImageBinder> (lldb) . however, the app seems to run fine in the preview. Does anyone know a fix for this issue?
In my case I had forgot to add the .environmentObejct(..) to the previews section. Also got it fixed by adding the environment to my preview.

How to trace a fatal error with Xcode and Swift?

I am trying to test a simple a program I have made while learning swift programming, but I always get a fatal error, and nothing will be shown.
I tried to copy my code to a playground, but there the custom classes I created are not recognized?
I found the error that one of the buttons is referencing the wrong outlet. This outlet was created by mistake, and it is name is the same as one of the Actions.

Xcode error at runtime

You can see the error in the image.
I don't even know what these errors mean, it was working fine before I updated Xcode for the iOS 6 update. I've done a few things to try and fix it such as change the target OS and do a Clean, but that has not worked.
I get the error after the app successfully is built and pushed to the device.
Your application crashed at runtime, because there was an exception.
The exception is written in your console log. We can see it in your capture:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x...> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
This means that somewhere in your application, you tried to set the "view" property of an object of type UIApplication, but UIApplication does not have any view property, so this crashes.
This is very likely that in your MainWindow.xib file, you connected a view IBOutlet to an object of type UIApplication, but this binding of your outlet is invalid because the outlet does not exist anymore.
(maybe you added the outlet at a given time, and binded/connected it in IB, and then removed it in your code, or maybe you binded the IBOutlet then changed the class of your object so the new class does not have the same outlets at all, whatever the outlet is now binded to a non-existant property in your XIB and that generates the crash)
To fix this, open your XIB file in interface builder and remove this invalid connection to your now non-existant outlet, and your exception should go away.
It means your program crashed. The error is in that box in the corner right. I can't see the whole error message, but it has something to do with key-value coding.
It might be the simple fact that you're running a slightly outdated version of your program. Delete it from the simulator or your device, clean and re-build your project, and let Xcode re-copy it over.

Cannot add a UIDatePicker to an xib without generating an Internal Error

I am using xCode 4.0.2 and trying to create a view controller with an xib that contains a UIDatePicker. Whenever I try to drag a UIDatePicker object to the view in the xib I get an Internal Error alert. This is a universal app and I am using an xib targeted for the iPhone.
Has anyone else experienced this or have any suggestions on how to work around this problem?
For now I am going to work around it by adding the UIDatePicker to the view in code.
Also, when I click the Crash button in the alert I am not getting the Crash Reporter. Isn't the Crash Reporter supposed to come up automatically? If this is a bug, how can I otherwise report it?
Thanks,
John
if you are using the Xcode UI and it crashes, assuming you don't have any huge environmental problems, no disk space... etc, that is a bug; and you should report it to:
bugreport.apple.com

Error on empty project: "this class is not key value coding-compliant for the viewcontroller."

this error drives me crazy. I already spent hours on fixing this, unfortunately without success.
I tested my app in simulator, everything works fine. I'am testing it on my device (iphone 4 with ios 4.3.3) the app won't start.
So I tried creating a new project, build and go. And the end of the error now says instead of viewcontroller, key window.
To get further information about the error I setup an exeption breakpoint whicht breaks on throw and on all exeptions. Something interesting happend now: when I am launching the empty project on my iphone I get a warning:
warning: Unable to read symbols for /Users/xxx/Library/Developer/Xcode/DerivedData/testing-cmaekkzgdqyseidlqkorvrdvvodg/Build/Products/Debug-iphoneos/OLDAPP.app/testing (file not found). (The app which I am runnning is called testapp, not OLDAPP?! This was my last project!)
Some further errors now occure:
Unknown class OLDAPPAppDelegate in Interface Builder file. and Unknown class RootViewController in Interface Builder file.
I did clean all targets and made a clean build. Nothing changes…
I didn't change anything in IB, just edited the provisioning profile to run the app on my phone.
Help is very appreciated here :-) Hopefully someone can help me I would be really thankful.
The whole error message: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UICustomObject 0x18b410> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key window.'
This happens to me if I change the name of an outlet on the ViewController which was connected to something in the View in Interface Builder. For example, renaming 'labelFirstName' to 'lblFirstName' and forgetting to break and recreate the connection in IB.
I had the same problem where there were no !'s in my XIB and no re-naming problems. To fix it, I just created a new XIB, copied in the view from the old XIB, and rewired all the connections.