V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
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 · 290 天前 · 1372 次点击
    这是一个创建于 290 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    winzkh
        1
    winzkh  
       290 天前   ❤️ 1
    判断系统版本不久行了嘛
    ```swift
    if #available(macOS 13.0, *) {
    print("System Settings")
    }else {
    print("System print("System Settings")")
    }
    ```
    winzkh
        2
    winzkh  
       290 天前
    前面打错了
    ```swift
    if #available(macOS 13.0, *) {
    print("System Settings")
    }else {
    print("System Preferences")
    }
    ```
    EVPATOR
        3
    EVPATOR  
    OP
       290 天前
    @winzkh 多谢,我一开始是尝试拿 BundlewithIdentifier 去拿 com.apple.systempreferences 系统设置的 bundle 的 plist ,结果怎么也拿不到。
    EVPATOR
        4
    EVPATOR  
    OP
       288 天前
    https://developer.apple.com/documentation/foundation/nsfilemanager/1409751-displaynameatpath 补充下,这个 api 可以实时拿到应用本地化的名称,不过缺点是如果用户系统和 app 的语言设置的不一样的话,只能拿到当前语言的名称,拿不到访达和 launchpad 里的名称
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   879 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:24 · PVG 05:24 · LAX 14:24 · JFK 17:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.