Mihir Oza
Mihir Oza

Reputation: 2796

Implicit conversion from enum type 'NSTextAlignment' aka 'enum NSTextAlignment' to diff. enumeration type 'UITextAlignment' aka 'enum UITextAlignment'

I am using Xcode 5.0.2 and getting the following warning when trying to compile my objective C code:

**Implicit conversion from enumeration type 'NSTextAlignment' (aka 'enum NSTextAlignment') to different enumeration type 'UITextAlignment' (aka 'enum UITextAlignment')**  

The Warning is in abcLabel.m:

_**CTTextAlignment alignment = CTTextAlignmentFromUITextAlignment(label.textAlignment);**_

Any help to fix this Warning?

Upvotes: 0

Views: 1684

Answers (1)

stefandouganhyde
stefandouganhyde

Reputation: 4544

In iOS 6+ UILabel's textAlignment property is of type NSTextAlignment (prior to that it was of type UITextAlignment). If you're compiling for iOS 6 or greater, simply switch to use NSTextAlignmentToCTTextAlignment() instead.

Upvotes: 1

Related Questions