Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting an "Implicit conversion from enumeration type" warning in Xcode for iOS and I don't know why

With this code:

NSDataDetector *detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink
                                                               error:&error];

I am getting this warning:

Implicit conversion from enumeration type 'enum NSTextCheckingType' to different enumeration type 'NSTextCheckingTypes' (aka 'enum NSTextCheckingTypes')

Can someone explain to me why I am getting this warning and how to fix it?

like image 287
Ethan Allen Avatar asked Jan 09 '13 00:01

Ethan Allen


1 Answers

+dataDetectorWithTypes: does claim to take a value from the NSTextCheckingTypes enum rather than NSTextCheckingType, but going by the rest of its documentation it should indeed allow you to specify individual values from the latter enum. I would just add a cast to NSTextCheckingTypes. You might also want to file a bug on the API.

like image 68
Noah Witherspoon Avatar answered Sep 21 '22 06:09

Noah Witherspoon