我在我的根视图控制器中有代码,它监视其@"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时,我需要调整视图大小.
处理这个问题的最佳方法是什么?
我的目标之一是使用 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)
……这就是机器人无法构建的原因。
知道为什么这不起作用吗?
谢谢。