I tried to connect the mapView to the controller on the storyboard and got the following error. What should I try?
2018-11-09 17:05:58.338255+0100 MeteoriteFinder[59395:4681901] +[CATransaction synchronize] called within transaction
2018-11-09 17:05:58.561153+0100 MeteoriteFinder[59395:4681901] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7ff1f64091e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mapView.'
*** First throw call stack:
It looks like the storyboard is still referencing the default UIViewController. You will need to update that in the identity inspector to use your MeteoriteMapViewController class. Those instructions are in the âWiring up the Storyboardâ section.
FYI - When I went to override mapViewDidFailLoadingMap, I used âctrl + oâ to find the method. When I did this, it inserted a call to its super method, which will cause an error. You need to delete that call to super.
@anm8tr thanks for pointing that out. It looks like there is not a compatible plugin for AppCode 2018.3 yet. Fingers crossed that itâs in the works and will be released in a reasonable amount of time
After putting MeteoriteMapViewController into the Identity Inspecter class field and connecting the mapView to the storyboard by putting the stuff in the storyboard xml (yes, I copied in the mapView id to the destination property) it still builds. But when I run in a simulator, I get:
Terminating app due to uncaught exception âNSInvalidArgumentExceptionâ, reason: â-[MeteoriteMapViewController superview]: unrecognized selector sent to instance 0x7fbb49c04740â
The error is shown as âSIGABRTâ in main.kt at the end of autoreleasepool
Cleaning the build folder does not help. I am using Xcode 10.1
@fullmers, that looks like MeteoriteMapViewController was set in the Identity Inspector of the MKMapVIew instead of the UIViewController. To fix, go back to the Identity Inspector where you entered MeteoriteMapViewController and delete it. When you delete it, it should show that the default class is a MKMapView. Next, head back to the âWiring up the Storyboardâ section of the tutorial and follow those steps again. The part that says âThen, click on the ViewController icon above the simulated phone:â, is the key to making sure you have the right item selected for entering the MeteoriteMapViewController. If that field defaults to UIViewController when nothing has been entered, then you are at the right spot to enter MeteoriteMapViewController.
Hi, thanks for this great tutorial. I was following the instructions. However, Iâm getting in red everything related to the iOS platform. Iâm not sure why. Also I tried to start from scratch with a new Kotlin/Native project but I realized that itâs getting created with the new build.gradle.kts (Kotlin DSL) instead of a regular build.gradle. So I think thatâs the reason. But Iâm still unable to finish the example. Does anyone know how to change the JVM of the project or how to support interopc but in the build.gradle.kts? Many thanks in advance!
Sorry for the late response. This tutorial was written with an older version of AppCode and the Kotlin Gradle plugin. Shortly after this tutorial came out, Kotlin Native had a major update that made this tutorial obsolete. If you are using a version of AppCode greater than 2018.2.3 and have a version of Kotlin greater than 1.3.0, the project in this tutorial will not build.
We have been watching the updates to Kotlin Native very closely and plan on updating this tutorial when development stabilizes a little.