Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when attempting to init subclassed BaseMessageCollectionViewCell - Release only #99

Closed
TimMumsnet opened this issue Apr 7, 2016 · 9 comments

Comments

@TimMumsnet
Copy link

I'm finding that initializing the TextMessageCollectionViewCell in the release build configuration causes a crash, for example:
TextMessageCollectionViewCell.sizingCell()

will call

private func commonInit() {

        // nil is returned here, and crashes    
        self.bubbleView = self.createBubbleView()
        ...
}

For some reason in release, self is type BaseMessageCollectionViewCell NOT TextMessageCollectionViewCell. But in the debug configuration, self is of type TextMessageCollectionViewCell (as expected).

Any ideas what could be triggering this?

Using Swift 2.2, Xcode 7.3

@diegosanchezr
Copy link
Contributor

Are you seeing this in ChattoApp? I can't reproduce it either on master or dev branches.

@TimMumsnet
Copy link
Author

You're right, I can't reproduce in the ChattoApp - I'm not sure if there's an extension or something that I'm missing, but simply calling
let cell = TextMessageCollectionViewCell.sizingCell()
in the AppDelegate will trigger the crash.

@diegosanchezr
Copy link
Contributor

Can you provide an example project where it reproduces?

@TimMumsnet
Copy link
Author

I've put together a project that quickly shows the problem I'm referencing, it should build if you download the zipped project, I'm not using Carthage or Pods, it's already setup to run in release.

https://github.com/TimMumsnet/TestChatApp.git

@diegosanchezr
Copy link
Contributor

Thanks @TimMumsnet

Looks like a compiler bug. I will try to isolate and reproduce it in a smaller project when I have some spare time. In the meanwhile disable whole-module-optimization for ChattoAdditions. Also, feel free to fill a bug report in https://bugs.swift.org, we might get some earlier feedback from Apple ( and post it here if you do so please )

@TimMumsnet
Copy link
Author

Great, thanks @diegosanchezr - that works for now and I'll let you know.

@diegosanchezr
Copy link
Contributor

@diegosanchezr
Copy link
Contributor

Fixed with Xcode 7.3.1

@TimMumsnet
Copy link
Author

Great, thanks!

Tim Windsor Brown
iOS Developer | mumsnet.com http://mumsnet.com/

On 4 May 2016, at 11:20, Diego Sánchez notifications@github.com wrote:

Fixed with Xcode 7.3.1


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #99 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants