How to import a private framework in Xcode 8.3 without getting “Undefined symbols for architecture arm64”

后端 未结 3 478
遥遥无期
遥遥无期 2021-01-01 07:50

I am trying to use _CDBatterySaver to turn on low power mode simply using

    [[_CDBatterySaver batterySaver] setMode:1];

I know there isn\

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-01 08:06

    Based on Siguza answer

    Newer versions of Xcode uses the tbd v2 format. Here is a .tbd stub file that will compile with the latest version of Xcode.

    --- !tapi-tbd-v2
    archs:           [ armv7, armv7s, arm64 ]
    uuids:           [ 'armv7: CBD84526-2D11-4CF3-83A7-4408DA532D3E', 'armv7s: 37ACF720-FA66-4B2D-8411-09D0B607E1A0',
                       'arm64: 19F91B79-9FA2-4944-9E68-3E632C938AE3' ]
    platform:        ios
    install-name:    /System/Library/PrivateFrameworks/CoreDuet.framework/CoreDuet
    objc-constraint: none
    exports:
      - archs:           [ armv7, armv7s, arm64 ]
        objc-classes:    [ __CDBatterySaver ]
        objc-ivars:      [ __CDBatterySaver._connection ]
    ...
    

提交回复
热议问题