저는 XCode 초심자입니다. 따라서 XCode 설명서에 제공된 "Hello World"예제를 시도했습니다. 빠른 시작 가이드 : Tutorial: Using Xcode to Write “Hello, World!” for OS X.Xode 4.5 Hello World 예제가 작동하지 않습니다.
필자는 OS 10.8.2를 사용하여이 문서를 작성한 사람의 문서에서 XCode 4.5.1을 사용하고 있습니다. 나는 지침을 따랐다. 예제가 작동하지 않았습니다. 창문을 만들었지 만 "안녕하세요 세상"인쇄가 아닙니다. 관련 코드 :
- (void)drawRect:(NSRect)dirtyRect
{
// Drawing code here.
NSString *hello = @"Hello, World!";
NSPoint point =NSMakePoint(15, 75);
NSMutableDictionary *font_attributes = [[NSMutableDictionary alloc] init];
NSFont *font = [NSFont fontWithName:@"Futura-MediumItalic" size:42];
[font_attributes setObject:font forKey:NSFontAttributeName];
[hello drawAtPoint:point withAttributes:font_attributes];
[font_attributes release];
}
두 가지 주목할만한 것들이 있습니다. 이 코드의 마지막 줄에 오류가 있습니다 :
release is unavailable: not available in automatic reference counting mode
그래서 나는 밖으로이 줄을 주석하고 프로그램을 실행했습니다. 창은 나타나지만 "Hello World"는 표시되지 않습니다.
"/Users/me/Library/ScriptingAdditions/YouHelper.osax/Contents/MacOS/YouHelper: no matching architecture in universal wrapper
Hello: OpenScripting.framework - scripting addition "/Users/me/Library/ScriptingAdditions/YouHelper.osax" declares no loadable handlers."
내가 뭔가 바보 같은 일을하고 있는가, 아니면 잘못된 예를 사용하고 있습니다 : 긴 메시지를 읽을 일부가 모든 출력에 등장!