nsomar / OAStackView

Porting UIStackView to iOS 7+
MIT License
2.14k stars 200 forks source link

Do not add subviews twice and thus not subscribe to KVO twice #77

Closed delebedev closed 8 years ago

delebedev commented 8 years ago

Setup for crashing is following (minimal one I've experienced in my app):

Apparently - (instancetype)initWithCoder:(NSCoder *)decoder returns view with subviews added. Even though addSubview: was clever enough to not add subview to stackView twice (removed line), it still had consequences: observers to hidden property (OAStackView+Hiding.h) where added twice which caused crash on master view deallocation.

delebedev commented 8 years ago

@m1entus JFYI