AliSoftware / OHAttributedLabel

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

Conflicting Parameter Types under Xcode 5 #154

Closed jdandrea closed 11 years ago

jdandrea commented 11 years ago

In Xcode Version 5.0 (5A11386k) I get "Conflicting Parameter Types in implementation of setTextAlignment:" and setLineBreakMode:.

The fix appears to be an easy one though: Change the lone parameter in each method to use NS instead of UI (e.g., NSTextAlignment and NSLineBreakMode, respectively). The underlying values are the same.

Apparently this used to be a warning, and now it's an error. See also:

http://stackoverflow.com/questions/12514421/deprecation-of-the-enum-uitextalignment-in-favor-of-nstextalignment-in-ios6

AliSoftware commented 11 years ago

I'll probably use the #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED safeguard I already use in the rest of my project, to keep it compatible with older SDKs (especially because OHAttributedLabel won't really be maintained much in a near future as UILabel now supports NSAttributedStrings natively so its sole purpose now is probably for older SDKs)

I thought I removed the warnings with this before, but if you tell me that there are still errors I definitely need to look at it.

jdandrea commented 11 years ago

Good move (for older SDK compatibility). As for UILabel supporting NSAttributed strings, point taken!

I only saw that one error as of Xcode 5. Otherwise, you're in good shape!

AliSoftware commented 11 years ago

Just pushed a fix for that, on a dedicated branch. Waiting for my download of Xcode5 GM Seed to finish (I was still at DP2 on my personal mac!! woops) so I can test with the latest Xcode version before merging and releasing a version.

AliSoftware commented 11 years ago

version 3.4.2 tagged and available in CocoaPods.