nicklockwood / FXLabel

[DEPRECATED]
http://charcoaldesign.co.uk/source/cocoa#fxlabel
Other
816 stars 125 forks source link

Crash when text is long Chinese or long words #10

Closed ytzong closed 11 years ago

ytzong commented 11 years ago

_label.numberOfLines = 0; _label.lineBreakMode = UILineBreakModeWordWrap; //for example: _label.frame.size.width = 100px

//crash when long Chinese _label.text = @"这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字这是一段长文字";

//or crash when long words _label.text = @"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

nicklockwood commented 11 years ago

I can't reproduce this. Can you make sure you are using the latest beta (the betas don't have distinct version numbers), and if so, can you provide a sample project demonstrating the problem?

ytzong commented 11 years ago

@nicklockwood https://github.com/ytzong/FXLabelCrash I add FXLabel (1.4.2) by CocoaPods, and Podfile content is

platform :ios, '6.0' pod 'FXLabel'

ytzong commented 11 years ago

@nicklockwood I'm sorry 2 hours ago the sample is emty, now is OK. Thank you.

https://github.com/ytzong/FXLabelCrash

nicklockwood commented 11 years ago

Hi ytzong,

This has been fixed in 5.0 beta, but is not yet on cocoapods. You can download it direct from github. I'll update the podspec when 5.0 is released.

ytzong commented 11 years ago

@nicklockwood Good job. Thank you very very much.