NSTaggedPointerString and Helper Class issues

Hello,

I'm running in to a problem. I have a helper calss for NSString and I'm getting an error ...


[NSTaggedPointerString containsString:ignoringCase:]: unrecognized selector sent to instance 0x6f15


Since NSTaggedPointerString is supposed to be a string this should not be an issue.


The offending code is ...


if ([[d objectForKey:@"sw_type"] containsString:@"m" ignoringCase:YES]) {
  isMandatory = YES;
}



Helper Code ...

-(BOOL)containsString:(NSString *)aString ignoringCase:(BOOL)flag
{
    unsigned mask = (flag ? NSCaseInsensitiveSearch : 0);
    NSRange range = [self rangeOfString:aString options:mask];
    return (range.length > 0);
}


I'm not sure what to do...


Thanks!

Replies

What do you mean by "helper class"? If "containsString:ignoringCase:" is method in a helper class, it is not a method of the NSString class.


Are you maybe talking about a category on NSString? In what context is the helper method declared?

Yes, sorry it's a category on NSString.


I think I may have found the answer on this. I was supporting much older OS's with my app and I had just set the min OS to 10.11. NSString now has a containsString method which was interfearing. Though I never got a compiler waring or error. Hmmm


Thanks!