• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextAlignment Enum?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextAlignment Enum?


  • Subject: NSTextAlignment Enum?
  • From: Dave <email@hidden>
  • Date: Mon, 01 Sep 2014 11:51:00 +0100

Hi,

I have a method that takes a String and depending on it’s value needs to return an NSTextAlignment type. However, if the string is invalid, then I want to indicate that an error so I pass back -1. This is fine expect I get warnings on this code:

if (myTextAllignment != -1)
	theFieldOutlet.textAlignment = myTextAllignment;

Warning:

Comparison of constant -1 with expression of type 'NSTextAlignment' (aka 'enum NSTextAlignment') is always true

What is the best way to fix this?

Thanks in advance
Dave


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTextAlignment Enum?
      • From: Keary Suska <email@hidden>
    • Re: NSTextAlignment Enum?
      • From: "Mills, Steve" <email@hidden>
  • Next by Date: Re: How to Validate CoreData attribute value for uniqueness
  • Next by thread: Re: NSTextAlignment Enum?
  • Index(es):
    • Date
    • Thread