AliSoftware / OHAttributedLabel

UILabel that supports NSAttributedString
https://github.com/AliSoftware/OHAttributedLabel/wiki
1.51k stars 344 forks source link

OHAttributedLabel carshes (points to null object) #170

Open haashem opened 10 years ago

haashem commented 10 years ago

I have used your great framework (latest update) in my app. I used its markup parser to detect special words and show its synonym.

but after touching some words it crashes suddenly with this strange error in device console:

: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary in Xcode 5 it doesnt crash soon. (maybe because of enough ram on my macBook). but in both it crashes. here is an screenshot of xcode: ![screen shot 2013-12-13 at 6 25 54 pm](https://f.cloud.github.com/assets/3206748/1743853/80665bde-6413-11e3-861d-d3a30ec4f72d.png) it doesnt show any error related to my code. it is memmory related error. how can I solve it?
AliSoftware commented 10 years ago

Following what I see on Google about this kind of error, it's an iOS6 bug, probably related to the fact that you somewhere use a nil/NULL value (like adding a NULL CGColor as an attribute of you string or something similar).

Check you NSAttributedString content and attributes before using it to see if there is nothing strange about it, like nonsense/mismatch attribute values or whatnot.

haashem commented 10 years ago

as you mentioned it only crashes on iOS6.

I have enabled NSZombies but instruments couldn't find any zombie!! I have use OHAttributedlLabel as it is without no modification. just added my custom markups. I haven't used NSAttributedString or CGColor. I haven't changed the appearance of OHAttributedlabel.

would you explain more about this bug?

I may post a sample app later and you can investigate it.

AliSoftware commented 10 years ago

A sample app to isolate the bug will definitely help investigate!

haashem commented 10 years ago

you can download from here: http://www.mediafire.com/download/e59dd7mmbu2gnmo/pageBasedApp.zip

I have attached your framework with my edits. just added my custom markup parser. run on your device. there you can see the crash immediately. may you explain why highlight link color won't appear in right position for farsi words?

it also sometimes crashes on line 403 of OHAttributedLabel.m. all this crashes happens on iOS 6