> On 1 Jan 2015, at 23:00, Uli Kusterer <witness.of.teacht...@gmx.net> wrote: > > On 01 Jan 2015, at 02:50, Jack Brindle <jackbrin...@me.com> wrote: >> You might want to extend that. The header file indicates that >> containsString: _only_ is available in OS X starting with 10.10 and iOS >> starting with 8.0. I would expect this to crash, or at least behave very >> poorly, under any prior OS since the call simply doesn’t exist there. >> >> Interesting that the only place it appears to be documented by Apple is in >> the header file. It is widely “documented” at various web sites, but using >> any call based on that is definitely rolling the dice. The central rule is >> that if you are releasing code for others to run, be sure to use calls that >> Apple documents to be available for the earliest targeted OS. >> >> I’d replace it with a more suitable call, which appears to be >> rangeOfString:options: The header file indicates it should be called with no >> options. in fact you probably should read the NSString header file info for >> that call. It is somewhat interesting. > > A good workaround is probably to create your own equivalent call with an > identical signature in a category and just replace all calls to > containsString with that: > > @implementation NSString (SBContainsStringBackwardsCompat) > > -(BOOL) sb_containsString: (NSString*)inString > { > return [self rangeOfString: inString options: 0].location != NSNotFound; > } > > @end >
I suspect this thread died at the point the OP realised they used a 10.10 method in the latest changes to the code which broke pre-10.10 compatibility, it had nothing to do with entitlements at all and backed that change out and replaced it with something pre 10.10 compatible. Would have been nice to have seen a follow up so the thread can help other people searching. SevenBits, people pitched in to help you here, what was the final resolution or do you still have an issue? _______________________________________________ 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