-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example Project Terminated With Xcode 4.5 and iOS 6 Simulator #74
Comments
…S6 SDK. Use setTextAlignment:lineBreakMode: on your NSAttributedString instead. (This fixes issue #74)
As it seems by the iOS6 Prerelease documentation, the type of the As I use this I just modified the class so that it now triggers an compilation error ("unavailable" attribute) if you try to use this constant while compiling with the iOS6 SDK, and a depreciation warning anyway before iOS6 SDK. This will show you exactly where the constant is used in your own code (if used) and where it should be replaced by the new way to do text justification, namely applying the text alignment attribute to your whole I also updated the example project to apply to this new rule, so you can get inspiration from here about this correct way of setting justification on your text, namely calling Note that I have tested it under the iOS6 SDK (as I only have the iOS6 SDK on my Mac at work, not here) so let me know if it fixed your issue. Thanks. PS: if you plan to distribute an iOS6-only application, as UILabel now support |
Thanks for fixing the code Seems like there still are some problem in the textAlignment part. -(IBAction)changeHAlignment In this part, when I try to run it twice, the iOS 6 Simulator crash and give this error message: I think there might be other problem in OHAttributedLabel about the textAlignment. I am just learning CoreText right now, so I can not give any suggestions about it, sorry. |
Errr I don't think you really understand how to interpret the exception. The cause of this exception is obvious: this is not related to the change made in UITextAlignmentJustify constant or to So this is exactly the same problem as before, and related to the fact that the example project uses the value There is an obvious easy fix: avoid using the UITextAlignmentJustify value (aka |
…ntJustify` / `(int)3` value in example project
Just trying the last version of the example project in the source code list.
Xcode gives this:
2012-08-17 03:01:36.448 AttribLbl[24381:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'textAlignment does not accept NSTextAlignmentJustified'
*** First throw call stack:
(0x17e6552 0x11cce7e 0x17e632b 0x55bc88 0x739d 0x2745 0x241d 0x3ff2e7 0x3ff8d7 0x400adb 0x411e15 0x412d4b 0x404828 0x2121e39 0x2121b10 0x175c1b5 0x175bf22 0x178d176 0x178c504 0x178c3db 0x40030a 0x40218c 0x233d 0x2275)
libc++abi.dylib: terminate called throwing an exception
However, everything is fine with Xcode 4.4.1 and iOS 5.1 simulator.
So that means OHAttributedLabel could not be used in iOS 6 anymore?
The text was updated successfully, but these errors were encountered: