Closed nguyentanhoangvu closed 10 years ago
It seems to be a memory managment problem in your usage of OHAttrbutedLabel
.
Make sure that you have a strong reference (and not a weak reference) to your OHAttributedLabel
instance, and more importantly (as it seems to be revealed by your crashlog) that you did not keep any reference to an OHAttributedLabel
instance even after it has been deallocated.
In your case, it seems that you have an observer on some property that triggers an action to your OHAttributedLabel
, but that OHAttributedLabel
does not exists anymore (has been deallocated in the meantime), but you forgot to remove your observer. Removing the observer when the label is deallocated will then solve the problem (which would not be related to OHAttributedLabel
by itself but is a memory mgmt issue in your code)
Migrating your project to ARC will probably be another solution to solve your problem, because the instance will be correctly deallocated and weak references to it will be set to nil (thanks to Zeroing-Weak References)
Thanks for your comment. My project is using ARC. I use 7 OHAttributedLabel instances. Once of them, I used retain reference (I have just changed retain to strong reference) and I sure that I use strong reference for other. I don't have any observer on any property to triggers an action to OHAttributedLabel. Maybe I am having about memory management problem. I will investigate. Thanks again.
https://github.com/AliSoftware/OHAttributedLabel/issues/82 This is another problem of drawTextInRect method. This issue is frequency crash, so it is difficult to reproduce crashing, so I cannot get more detail to investigate. Please help me! Crash log is as below: