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 on presentMessageView #18

Closed
pmagnussen opened this issue Apr 6, 2017 · 8 comments
Closed

Crash on presentMessageView #18

pmagnussen opened this issue Apr 6, 2017 · 8 comments

Comments

@pmagnussen
Copy link

pmagnussen commented Apr 6, 2017

We have a crash on presentMessageView that we can't quite wrap our head around.

Here are two screenshots from the stacktrace.

screen shot 2017-04-06 at 12 52 42

screen shot 2017-04-06 at 12 52 27

Have you experienced this crash before?

@isadon
Copy link
Owner

isadon commented Apr 6, 2017

Delegate properties should always (barring special circumstances) be weak so yes this is something that will be fixed. Hopefully that should resolve your crash.

Update: Interestingly enough the reason why its assign (I always make my delegates weak) is because of RMessage having initialized its codebase from TSMessages, TSMessages has it the way it is now, "assign" hmmm...

@pmagnussen
Copy link
Author

I tried setting it to weak but could still reproduce the crash :/

@isadon
Copy link
Owner

isadon commented Apr 6, 2017

Are you changing your delegate in the middle of presentation or clearing the delegate anywhere. Anything interesting you may be doing in your code? After setting the property to weak can you clear your derived data and rebuild your project? Reset the simulator as well if need be.

@pmagnussen
Copy link
Author

I haven't found anything particularly interesting yet - still trying to find the exact steps to reproduce the issue. Right now I can only reproduce it semi-randomly.

Could you change it to be a weak reference none the less?

@pmagnussen
Copy link
Author

I'll try clearing derived data now and see what happens.

@pmagnussen
Copy link
Author

I think clearing derived data did the trick. I can't seem to reproduce it anymore.

So to sum up: setting the delegate to weak should resolve this issue.

@isadon
Copy link
Owner

isadon commented Apr 6, 2017

Yup. I dont know why the original TSMessages had the property set to assign but there is a very crucial fundamental difference between assign and weak in the instance of a delegate property. When set to assign if the delegate becomes deallocated the property would be pointing to garbage (bad) while when its weak the property becomes nil which is the correct implementation.

@pmagnussen
Copy link
Author

Thanks for fixing this so quickly.

@isadon isadon closed this as completed Apr 6, 2017
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