如何在iOS中获取正在运行的应用程序的名称 [英] How to get the name of the running application in iOS

查看:95
本文介绍了如何在iOS中获取正在运行的应用程序的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果主屏幕上图标下的应用程序名称是My Awesome App,那么如何在运行时在应用程序中获取该字符串?

If the application name under the icon on the home screen is "My Awesome App" how do you get that string within the application at runtime?

推荐答案

我试试

[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];

虽然您可能知道自己的应用程序名称并且可以使用它...

although presumably you know your own app’s name and can just use it…

这篇关于如何在iOS中获取正在运行的应用程序的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆