Two of my programs, available on the AppStore for several months and working without any problems on iOS3 and iOS4, are not compatible with iOS5.
It seems to me that Apple has changed some things to make the life of developers a little more complicated.
One problem is this:
- (BOOL) webView: (UIWebView *) webView shouldStartLoadWithRequest:(NSURLRequest *) request navigationType: (UIWebViewNavigationType) navigationType { // Only do something if a link has been clicked if (navigationType == UIWebViewNavigationTypeLinkClicked) { NSString *link = [[request URL] absoluteString]; if ([link hasPrefix:@"playSound:"]) { [PlayAudio playAudio: [link substringFromIndex:10]]; return NO; } } return YES; }
The line that creates the problem,
NSString *link = [[request URL] absoluteString];
Before I get an unmodified copy of a clicked link. On iOS3 and iOS4 anyway. But on iOS5, it only converts to lowercase. Next line
if ([link hasPrefix:@"playSound:"]) {
never becomes true. So I had to change the code to
- (BOOL) webView: (UIWebView *) webView shouldStartLoadWithRequest:(NSURLRequest *) request navigationType: (UIWebViewNavigationType) navigationType { // Only do something if a link has been clicked if (navigationType == UIWebViewNavigationTypeLinkClicked) { NSString *link = [[[request URL] absoluteString] lowercaseString]; if ([link hasPrefix:@"playsound:"]) { [PlayAudio playAudio: [link substringFromIndex:10]]; return NO; } } return YES; }
Now I expect lowercase letters for all versions of iOS and therefore compare them with a lowercase string.
What do you think: do you need changes in the new version of iOS?
source share