Skip to content

Compiler Warning - NSLineBreakMode versus UILineBreakMode #3

@basil-bourque

Description

@basil-bourque

After pasting the latest version of JSNotifier into my Xcode project (newly upgraded from Xcode 4 to 5, now built on iOS 7 libraries but targeting iOS 5 and later) I encountered this compiler warning:

…/JSNotifier.m:151:12: Implicit conversion from enumeration type 'NSLineBreakMode' (aka 'enum NSLineBreakMode') to different enumeration type 'UILineBreakMode' (aka 'enum UILineBreakMode')

According to this question and this question on StackOverflow:

  • Apple is removing the redundant UILineBreakMode enum in favor of going with NSLineBreakMode enum.
  • Both enums have the same value. So after compiling there is no difference.

So it seems to me the best way to eliminate this compiler warning is to change all your declarations of UILineBreakMode to NSLineBreakMode. Since Apple now requires us to use Xcode 5', this should be compatible for all the programmers while also being compatible for deploying to older versions of iOS. I have done so manually in my local copy of JSNotifier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions