googlevr / gvr-ios-sdk

Google VR SDK for iOS
http://developers.google.com/vr/ios/
Other
645 stars 191 forks source link

Converting GVRRendererView into Swift version; crashed on GVROverlayView #312

Closed NathanaelA closed 6 years ago

NathanaelA commented 6 years ago

This line of code (in GVRRendereredView.mm) _overlayView = [[GVROverlayView alloc] initWithFrame:self.bounds]; is converted to in Swift _overlayView = GVROverlayView(frame: bounds) when it runs it throws the following error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSURL initFileURLWithPath:]: nil string parameter'

Any source code around for the GVROverlayView which can explain why this is failing?
Please note if I use the standard ObjC version of GVRRendererView I don't see this crash...

Performador commented 6 years ago

Hi Nathanael, I was unable to repo this.

A simple project with the main VC with a GVROverlayView in Swift seems to work as expected.

Any sources you can share? Is your GVRSDK up to date?

NathanaelA commented 6 years ago

This is weird; I un-commented the code and it is now working. I have been using the latest version.

I honestly have no idea why it was failing. The code was throwing that error the minute I created the GVROverlayView and that was the error. So, maybe you can do a search inside the GVROverlayView and see if there is some corner case where it uses a NSURL that could be nil...

I'm going to close the issue since it no longer seems to be an issue... Thanks..

NathanaelA commented 6 years ago

Any chance the GVROverlayView code will be opensourced?