I am facing a strange issue in my app with iOS14 there is a intermittent crash, i am using NetServiceBrowser for MDNS discovery not sure if that is causing the problem crash log has below information:
Crashed: com.apple.main-thread
0 CoreFoundation 0x1a906c4c4 CFAssertMismatchedTypeID + 108
1 CoreFoundation 0x1a8f7db0c CFRunLoopSourceRemoveFromRunLoop + 298
2 CFNetwork 0x1a96255b0 CFNetServiceBrowserStopSearch + 460
3 CoreFoundation 0x1a8f81240 CFRUNLOOPISCALLINGOUTTOASOURCE0PERFORMFUNCTION + 24
4 CoreFoundation 0x1a8f81140 CFRunLoopDoSource0 + 204
5 CoreFoundation 0x1a8f80488 CFRunLoopDoSources0 + 256
6 CoreFoundation 0x1a8f7aa40 CFRunLoopRun + 776
7 CoreFoundation 0x1a8f7a200 CFRunLoopRunSpecific + 572
8 GraphicsServices 0x1bf075598 GSEventRunModal + 160
9 UIKitCore 0x1ab840004 -[UIApplication run] + 1052
10 UIKitCore 0x1ab8455d8 UIApplicationMain + 164
Yes. using Multipeer Connectivity
OK. In that case my answer is that you should stop using Multipeer Connectivity. This is a long-standing bug and, while I can’t predict the future with 100% accuracy, I think it’s reasonable to infer future behaviour from past behaviour. In this case, you’re looking at a crashing bug that’s been around for at least 3 years old [1]. How long are you prepared to wait for a fix?
IMO Multipeer Connectivity should be officially deprecated in favour of Network framework [2]. If you’d like to make that transition:
-
Check out the Building a custom peer-to-peer protocol sample code.
-
If you get, stuck a new thread with the details. Tag it with Network so that I see it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Based on the age of this thread. I suspect that this bug has been around for much longer than that.
[2] And, to be clear, this is a personal opinion. I don’t set official Apple policy for this stuff. The official policy is in TN3151 Choosing the right networking API, which has to walk a fine line because Multipeer Connectivity isn’t officially deprecated.