Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7199

`Unknown class in Interface Builder file.` error and `init?(coder:)` of a custom UIView not called

$
0
0

I have a view that can be created when it is set as the custom class of an empty view in Interface Builder. It goes like this:

class UpcomingAppointmentView: UIView {    required init?(coder: NSCoder) {        super.init(coder: coder)        // Instantiate and set as subview of the empty view using Rswift        guard let nib = R.nib.upcomingAppointmentView(owner: self) else { return }        addSubview(nib, method: .fill)    }}

I use this class like so:

The Interface Builder

The Identity Inspector

This will automatically create the UpcomingAppointmentView anywhere I like just by setting the custom class. And it always call the init?(coder:) to do it.

In my previous commits, it usually works both on simulator or actual device. However, now it didn't work as expected. Now, on the simulator, this is working as usual. But it crashes on actual devices. It displayed this on the console: Unknown class _TtC8Kolibree23UpcomingAppointmentView in Interface Builder file.. When I tried adding some breakpoints, the breakpoint in init?(coder:) didn't get called. I haven't touched the class or the storyboard at all. All I did was just changing the Carthage dependencies' settings from using fat frameworks to XCFrameworks.

Can anybody help me? Thanks.

EDIT: I checked out the latest master branch which doesn't have the XCFrameworks Carthage and it is working fine on actual devices.


Viewing all articles
Browse latest Browse all 7199

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>