从Xcode开始,在我的代码中,如何显示控制台并清除屏幕?
我知道我可以用Xcode首选项来做,但我想以编程方式进行.
解决方法 这对我有用 – 如果您希望Xcode保持在应用程序之上,请省略最后一个激活部分:bool ClearXCodeDeBUGgerConsole(){ Nsstring *const scriptText = @"\tell application \"System Events\"\n\set currentapp to the name of the current application\n\end tell\n\tell application \"Xcode\" to activate\n\tell application \"System Events\"\n\keystroke \"r\" using {command down,control down,option down}\n\end tell\n\tell application currentapp to activate\n\return true"; NSAppleScript *script = [[[NSAppleScript alloc] initWithSource:scriptText] autorelease]; [scriptText release]; NSDictionary *dictError = nil; NSAppleEventDescriptor *result = [script executeAndReturnError:&dictError]; if (!result) return false; if ([result booleanValue] != YES) return false; return true;}总结
以上是内存溢出为你收集整理的Xcode控制台,以编程方式清除屏幕全部内容,希望文章能够帮你解决Xcode控制台,以编程方式清除屏幕所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)