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 actual NSTextAlignment value as &myTextAlignment, 
e.g.

if ([self getBestAlignmentWithParam1:p1 andParam2:p2 andParam3:p3 
returnTextAlignment: &myTextAlignment] == NO)
        {
// do something else
        }

Cheers
Dave


On 1 Sep 2014, at 18:30, Mills, Steve <smi...@makemusic.com> wrote:

> 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,
>>   MYRightTextAlignment    = NSRightTextAlignment,
>>   MYCenterTextAlignment    = NSCenterTextAlignment,
>>   MYJustifiedTextAlignment    = NSJustifiedTextAlignment,
>>   MYNaturalTextAlignment    = NSNaturalTextAlignment
>> };
> 
> I was thinking of that too, but it doesn't future-proof it if Apple adds more 
> enums, especially if new ones are out of the max signed int range.
> 
> Steve via iPad
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to