3
votes

Before iOS 10 below code gives me proper result but not after iOS 10. No idea how could iOS version cause the problem.

NSString *string = @"<img width=\"30%\" src=\"https://private_server.com/sample_endpoint/example.png\" border=\"3\" />";

NSError *error = nil;
[_textView setAttributedText:[[NSAttributedString alloc] initWithData:[string dataUsingEncoding:NSUTF8StringEncoding] options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType} documentAttributes:nil error:&error]];

No error observed when allocating NSAttributedString but in console below warning is printed.

objc[88018]: Class PLBuildVersion is implemented in both /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x1111a4998) and /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x110639d38). One of the two will be used. Which one is undefined.

Breaking my head on this for hours. Any help would be greatly appreciated.

enter image description here enter image description here

1
Have you tried on real device?Andrea
Same problem occurs in device also @AndreaRajesh
may be privacy issue add key <key>NSPhotoLibraryUsageDescription</key> <string>Photo Library Access Warning</string>Ravi Panchal

1 Answers

0
votes

It seems a bug, check bug report at:

http://www.openradar.me/27820992

Problem may be because of PLBuildVersion is defined in both PhotoLibraryServices.framework and AssetsLibraryServices.framework, so which one to use is undefined.

Possible solutions could be:

Setting following keys into your Info.plist file

  1. Photo

    Key: Privacy - Photo Library Usage Description Value: $(PRODUCT_NAME) photo use

  2. Camera

    Key: Privacy - Camera Usage Description Value: $(PRODUCT_NAME) camera use

Hope this will help:)