NSTextAlignment Enum?

2014-09-01 Thread Dave
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)

Re: NSTextAlignment Enum?

2014-09-01 Thread Mills, Steve
On Sep 1, 2014, at 5:51, Dave d...@looktowindward.com wrote: 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

Re: NSTextAlignment Enum?

2014-09-01 Thread Keary Suska
On Sep 1, 2014, at 4:51 AM, Dave d...@looktowindward.com wrote: 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

Re: NSTextAlignment Enum?

2014-09-01 Thread Keary Suska
On Sep 1, 2014, at 9:28 AM, Keary Suska cocoa-...@esoteritech.com wrote: On Sep 1, 2014, at 4:51 AM, Dave d...@looktowindward.com wrote: 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

Re: NSTextAlignment Enum?

2014-09-01 Thread Mills, Steve
On Sep 1, 2014, at 11:44, Keary Suska cocoa-...@esoteritech.com wrote: One future-proof approach that occurred to me is to declare your own enum: typedef NS_ENUM(NSInteger, MYTextAlignment) { MYInvalidTextAlignment= -1, MYLeftTextAlignment= NSLeftTextAlignment,

Re: NSTextAlignment Enum?

2014-09-01 Thread Dave
Hi, The method that returns the NSTextAlignment is interpreting other data to come up with the best alignment, if there is no “Best Alignment” it needs to signal this back to the caller. I’ve solved the problem by returning a BOOL to say if the NSTextAlignment is valid or not and passing the