The second time I try to present a view controller with a WRArchitectView it fails with a large error stating that a second architect view is attempting to be allocated before the first has been deallocated. I've checked up an down, have ARC enabled, the view controller is completely deallocated. I even have a branch which is working with an identical view controller, so what could be retaining the WTArchitectView?
1 Answer
I was writing JSON in a Swift Utility class while the view controller was instantiated which wasn't being handled well. I was getting an error along the lines of *** WebKit discarded an uncaught exception
. Somehow, parsing malformed JSON with NSJSONSerialization
and not handling the exception halts some Wikitude internals, which means something internal was retaining the view. Fixing my JSON allowed Wikitude to dealloc properly.