Post

Replies

Boosts

Views

Activity

Reply to Crash: [NSTaggedPointerString count]: unrecognized selector sent to instance 0x8000000000000000
Yes, properties() is called on the main thread. Also data is being accessed from the main thread, and from a background thread that corresponds to the first async work. func properties() { let group = DispatchGroup() group.enter() UNUserNotificationCenter.current().getNotificationSettings { (notification) in let value = … some calculation … self.data.updateValue(value, forKey: "my_wonderful_key") group.leave() } group.enter() MyClass.someMethod { (granted) in let value2 = … some calculation … self.data.updateValue(value2, forKey: "my_wonderful_key_2") group.leave() } group.notify(queue: DispatchQueue.main) { print("Yay. Operation completed!") completionHandler(self.data) } } As you can see, in the first block, data is being accessed in the getNotificationSettings completionHandler which is executed on a background thread. On the other hand, in the other two (2) blocks data is being accessed on the main thread, since those two blocks MyClass.someMethod and group.notify run in the main queue. One more thing is that I have crash reports for all these 3 lines: self.data.updateValue(value, forKey: "my_wonderful_key") self.data.updateValue(value2, forKey: "my_wonderful_key_2") completionHandler(self.data) So I wonder if the fact that data is accessed from a background thread in the first block is causing that the app is crashing then when the same data is accessed from the main thread in the block 2 and 3? if that would be the cause, just wrapping the code with an async block in the main queue would work? That way the data is only accessed from the main thread group.enter() UNUserNotificationCenter.current().getNotificationSettings { (notification) in let value = … some calculation … DispatchQueue.main.async { self.data.updateValue(value, forKey: "my_wonderful_key") group.leave() } Thanks!
Jun ’21
Reply to How to detect if an iPad has GPS
Thanks eskimo. While the Core Telephony Framework provides APIs to access the carrier data, cellular data state, and so on, this does not seem to provide an API to return if the device is cellular capable or not. While it might be true today, it’s easy to imagine Apple adding GPS to a device that doesn’t have cellular. Right, a new device like this would break this implementation. But until then, we would have a hacky way to detect this, which does not seem bad. I also think it's a good moment to think if this is really needed.
May ’21
Reply to Crash: IndexPath.section.getter + 168
so the count is 0. So, we’ll still not sure how you got here, but at least we know why you crashed. So since the count is 0, this confirms that the app is hitting a IndexPath.section assert. This is still weird for me why this is happening, but for the users' sake I will put some defensive code checking that the count property is equal to 2 before accessing to the indexPath.section property. Hopefully, this will prevent this crash. In the case that for some reason this does not work, I will need to go back to this. Thank you for confirming this and for helping me out!
Oct ’20
Reply to Crash: IndexPath.section.getter + 168
I see. I took this from our crash reporting service. I am attaching a crash log from the user device (this is the same user that was experiencing the crash). I'm guessing this is a full crash log since this includes the termination signal and reason, etc. Is this correct? Unfortunately, I haven't had the chance to symbolicate this myself. This is needed or are we more interested in the exception/termination data? Unsymbolicated crash log - https://developer.apple.com/forums/content/attachment/398569ca-e3c8-4c85-ab60-f9e185cfd51d Thanks a lot!!
Oct ’20
Reply to Crash: IndexPath.section.getter + 168
enum ScreenSection : Int { case firstSection case secondSection case thirdSection } extension TableDelegate: UITableViewDataSource {    func numberOfSections(in tableView: UITableView) -> Int {      return 3    } @available(iOS 11.0, *)   func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {            let section = ScreenSection(rawValue: indexPath.section) <- Here it is crashing     guard let screenSection = section else {      return nil      } More code... Thank you for the responses! Claude31, I just attached some code that shows the numberOfSections and the line where the app is crashing. eskimo, thank you for that explanation. I went ahead with trying your example on a playground and indeed, I get a EXC-BAD-INSTRUCTION error for the first and third case. But I don't understand why a trap fires if the indexPath has a count other than 2. I'm also curious if this is somehow related to saying that the table view should have 3 sections? Do you know if there is something wrong about the code itself? Because I'm receiving that indexPath from the trailingSwipeActionsConfigurationForRowAt function as you can see. Or this is a bug in the language? or how could I fix this? Checking the indexPath.count and saying that this needs to be 2 in order to access the IndexPath.section property? Thank you in advance
Oct ’20
Reply to Building for Simulator works in Xcode 12 beta but not with xcodebuild
I am experiencing the same error when trying to build a framework for the simulator SDK on Xcode 12. This seems that it is an issue related to the linker or xcodebuild command itself, this was not an issue for me on Xcode 11. In my case, adding the arm64 architecture to the excluded architecture build setting worked so that we were able to send a provisional framework for our client only supporting simulator on Xcode 12. This seems that the error is being found on Crashlytics in your case. Adding arm64 to the excluded architectures should help with this issue, sadly this does not seem to be the case. I also reported this as a bug using the Feedback assistant. I'm hoping this helps for its resolution.
Sep ’20
Reply to Cannot build archive when using xcodebuild -archive
I am having the same issue while running pod lint against a framework compiled with Xcode 12 beta 4 and 6, error is:     The following build commands failed:     Ld /Users/<username>/Library/Developer/Xcode/DerivedData/App-fvgguosjareejfejmqgeiwccnzmo/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/Binary/App normal arm64     (1 failure)    Testing with xcodebuild This was not happening with Xcode 11.x versions. Did you find any workaround for this?
Sep ’20