OHAttributedLabel icon indicating copy to clipboard operation
OHAttributedLabel copied to clipboard

OHAttributedLabel carshes (points to null object)

Open haashem opened this issue 12 years ago • 4 comments

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: <Error>: 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

it doesnt show any error related to my code. it is memmory related error. how can I solve it?

haashem avatar Dec 13 '13 16:12 haashem

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.

AliSoftware avatar Dec 15 '13 16:12 AliSoftware

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.

haashem avatar Dec 17 '13 19:12 haashem

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

AliSoftware avatar Dec 18 '13 16:12 AliSoftware

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

haashem avatar Dec 18 '13 20:12 haashem