Attempt to present UIViewController on UIViewController whose view is not in the window hierarchy

Where are you calling this method from? I had an issue where I was attempting to present a modal view controller within the viewDidLoad method. The solution for me was to move this call to the viewDidAppear: method. My presumption is that the view controller’s view is not in the window’s view hierarchy at the point that it has been loaded … Read more

What are the difference between macOS and iOS?

A macOS and iOS share many of the same frameworks, low level (kernel) code, and share a common kernel and several core components. You can read about that in the following Wikipedia article: Darwin (operating system) However when it comes to their differences, it became a bit more complicated to find out. Can anyone help … Read more

Xcode – How to fix ‘NSUnknownKeyException’, reason: … this class is not key value coding-compliant for the key X” error?

Your view controller may have the wrong class in your xib. I downloaded your project. The error you are getting is ‘NSUnknownKeyException’, reason: ‘[<UIViewController 0x3927310> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key string.’ It is caused by the Second view controller in MainWindow.xib having a class of UIViewController instead of SecondView. Changing to the correct class resolves the … Read more

Xcode 10, Command CodeSign failed with a nonzero exit code

Everytime I build console is showing this message. CodeSign /Users/admin/Desktop/AppStoreBuild/Project201/build/Debug-iphonesimulator/Project.app (in target: Desker) cd /Users/admin/Desktop/AppStoreBuild/Project201 export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate Signing Identity: “-“ /Users/admin/Desktop/AppStoreBuild/Project201/build/Debug-iphonesimulator/Project.app: resource fork, Finder information, or similar detritus not allowed Command CodeSign failed with a nonzero exit code … Is there any way to identify the cause of this failure. It’s showing Signing Identity: “-” when … Read more

How do you create a Swift Date object?

Swift has its own Date type. No need to use NSDate. Creating a Date and Time in Swift In Swift, dates and times are stored in a 64-bit floating point number measuring the number of seconds since the reference date of January 1, 2001 at 00:00:00 UTC. This is expressed in the Date structure. The following would give you the current … Read more