小编Mik*_*ner的帖子

- [UIApplication setStatusBarHidden:withAnimation]不会为@"statusBarHidden"键触发KVO通知

我在我的根视图控制器中有代码,它监视其@"statusBarHidden"属性-[UIApplication sharedApplication]并调整其视图的大小作为响应.

当我这样做时,会触发KVO通知:

[[UIApplication sharedApplication] setStatusBarHidden:YES]
Run Code Online (Sandbox Code Playgroud)

但是当我这样做时,不会触发KVO通知:

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]
Run Code Online (Sandbox Code Playgroud)

当状态栏重新出现但我正在使用调用后一种方法的第三方API时,我需要调整视图大小.

处理这个问题的最佳方法是什么?

uikit ios

6
推荐指数
1
解决办法
1977
查看次数

Xcode Server bot 无法使用 defaults 命令读取属性列表

我的目标之一是使用 defaults 命令读取属性列表的外部构建工具。

当机器人运行该工具时,defaults 命令无法找到指定的默认值:

defaults read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version CFBundleShortVersionString

> The domain/default pair of (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version, CFBundleShortVersionString) does not exist
Run Code Online (Sandbox Code Playgroud)

从普通用户的帐户运行相同的命令可以正常工作:

defaults read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version CFBundleShortVersionString

> 7.1
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,它不适用于 _teamsserver 用户:

sudo -u _teamsserver defaults read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version CFBundleShortVersionString

> The domain/default pair of (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version, CFBundleShortVersionString) does not exist
Run Code Online (Sandbox Code Playgroud)

……这就是机器人无法构建的原因。

知道为什么这不起作用吗?

谢谢。

macos xcode command-line nsuserdefaults xcode-server

5
推荐指数
1
解决办法
354
查看次数

标签 统计

command-line ×1

ios ×1

macos ×1

nsuserdefaults ×1

uikit ×1

xcode ×1

xcode-server ×1