2010-10-05 6 views

ответ

1

Вы можете отобразить окно консоли, нажав Shift + Command + R. Вы можете очистить окно консоли, нажав Control + Option + Command + R. Оба варианта доступны из меню «Выполнить».

+0

Спасибо за помощь здесь, но это один не помог мне программно. – eGanges

3

Это работает для меня - оставить из последней реактивировать часть, если вы хотите 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; 
} 
+0

Точная для AppKit (OS X), но, к сожалению, это не так для iOS UIKit. В частности, библиотека iOS #import , как она получена из документации AppKit @import Foundation, не поддерживает NSAppleScript и NSAppleEventDescriptor. https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSAppleScript_Class/ – eGanges

Смежные вопросы