ryanmcgrath / cacao

Rust bindings for AppKit (macOS) and UIKit (iOS/tvOS). Experimental, but working!
MIT License
1.79k stars 65 forks source link

Class with name RSTApplication could not be found #82

Closed semtexzv closed 1 year ago

semtexzv commented 1 year ago

I'm trying to build on top of trunk with some builder code for easier creation of simple UIs, but I keep hitting this error:

thread 'main' panicked at 'Class with name RSTApplication could not be found',

Occurs at https://github.com/ryanmcgrath/cacao/blob/a1f2711cebc1d429859e1fadf2f11ceed9e76987/src/appkit/app/mod.rs#L126

ryanmcgrath commented 1 year ago

Hmm, that's very odd - can you share a more full code sample that I could take a look at?

Chances are this just needs that class! call replaced with a register... call, but I'm curious if you have something else in the setup flow going on considering this isn't a widely reported bug.

(or if it's a regression here, somehow)

semtexzv commented 1 year ago

Occurs with running one of the examples for me.

ryanmcgrath commented 1 year ago

This should be fixed now - a recent PR somehow had tests pass automatically but introduced this bug, which I guess we need to look at... though the issue does come down to ObjC being possible to error at runtime, which this bug was. Compiler couldn't have caught it.