Problems using NSAttributedStrings in combination with JavaScript MediaRecorder

I found out, that an iOS app will crash, when you reproduce the following steps:

  1. Create an NSAttributedString with doctype html. It is not necessary to actually assign this string to a Label or TextView. Just creating such a String is enough.
  2. Now open a WKWebView and load an html page, that uses JS MediaRecorder to record audio from device microphone.

Reason for the crash are than UI operations not performed on main thread.

Important to notice. The same website works before the first init of NSAttributedString without problems.

Afterwards comes the crash.

I created small repo to demonstrate the issue here: https://github.com/marcelderkskarlmax/AttributedStringBugDemo

I think this is a bug in NSAttributedStrings but if anybody has a different clue that would be great.

Thanks in advance

You don’t a web view to crash the HTML importer in NSAttributedString. See this thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Problems using NSAttributedStrings in combination with JavaScript MediaRecorder
 
 
Q