V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
EVPATOR
V2EX  ›  iDev

请教一下如何获得 macOS 系统内置应用的名字?

  •  
  •   EVPATOR · Jul 12, 2023 · 2228 views
    This topic created in 1021 days ago, the information mentioned may be changed or developed.

    最近有个需求需要在界面上弹出一个提示框引导用户在系统的设置菜单中勾选某些选项,macOS 在 Ventura 之前系统设置菜单叫 System Preferences ,但是在 Ventura 及之后改成了 System Settings 。在非 sanbox app 的环境下有没有接口可以获取系统设置菜单的名字?

    winzkh
        1
    winzkh  
       Jul 12, 2023   ❤️ 1
    判断系统版本不久行了嘛
    ```swift
    if #available(macOS 13.0, *) {
    print("System Settings")
    }else {
    print("System print("System Settings")")
    }
    ```
    winzkh
        2
    winzkh  
       Jul 12, 2023
    前面打错了
    ```swift
    if #available(macOS 13.0, *) {
    print("System Settings")
    }else {
    print("System Preferences")
    }
    ```
    EVPATOR
        3
    EVPATOR  
    OP
       Jul 12, 2023
    @winzkh 多谢,我一开始是尝试拿 BundlewithIdentifier 去拿 com.apple.systempreferences 系统设置的 bundle 的 plist ,结果怎么也拿不到。
    EVPATOR
        4
    EVPATOR  
    OP
       Jul 14, 2023
    https://developer.apple.com/documentation/foundation/nsfilemanager/1409751-displaynameatpath 补充下,这个 api 可以实时拿到应用本地化的名称,不过缺点是如果用户系统和 app 的语言设置的不一样的话,只能拿到当前语言的名称,拿不到访达和 launchpad 里的名称
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5616 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 01:32 · PVG 09:32 · LAX 18:32 · JFK 21:32
    ♥ Do have faith in what you're doing.