Monday, February 5, 2024
HomeiOS Developmentswift - iOS find out how to get CPU structure given NXGetLocalArchInfo...

swift – iOS find out how to get CPU structure given NXGetLocalArchInfo has been deprecated?


I’m engaged on a “system data” app and it reveals the CPU structure. I’ve been utilizing this code which works wonderful.

  func getArchitecture() -> String? {
    guard
      let data = NXGetLocalArchInfo(),
      let string = data.pointee.description
    else { return nil }
    return String(utf8String: string)
  }
  

The NXGetLocalArchInfo perform has been deprecated in iOS 16, and I do not know what to make use of as a substitute.

Edit: After some analysis, it seems like the brand new API must be macho_arch_name_for_mach_header: https://github.com/firebase/firebase-ios-sdk/commit/19c1b15f7c012b0633eb74fd2effd961c88d28a3

Nonetheless, I do not know find out how to write it in Swift. Please assist.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments