2010-01-22 4 views
1

눈이 os와 호환되지 않는 응용 프로그램을 개발 중입니다. 사용자가 눈이 오면 응용 프로그램을 시작하려고 할 때 경고 메시지를 표시 할 수 있습니까?응용 프로그램 시작 코코아 전에 버전 확인

+0

어, 당신이 정말로 그것을 10.5이 아닌 10.6와 호환 의미합니까? 보다 일반적인 질문은 10.6과 호환되고 10.5가 아닌 것을 지정하는 방법입니다. – Ken

+0

예 10. 내 앱이 10.6과 호환되지 않아 버전 10.6에서 경고 메시지를 표시해야합니다. – MobX

+2

이전 질문과 다른 점은 무엇입니까? http://stackoverflow.com/questions/2115373/os-version-checking-in-cocoa –

답변

0

LSMinimumSystemVersion 키를 앱의 Info.plist에 추가해야합니다. documentation에 따라 n은 숫자입니다

이 문자열은 n.n.n 형식이어야합니다. 첫 번째 숫자는 이며 시스템의 주 버전 번호입니다. 두 번째와 세 번째 숫자 인 은 부 개정 번호입니다. 예를 들어 나중에 Mac OS X v10.4 및 을 지원하려면이 키의 값을 "10.4.0"으로 설정하십시오.

+0

질문자의 이전 질문에서 같은 실수를했습니다. 이 응용 프로그램은 Leopard에서 제대로 작동하지만 일부 지정되지 않은 이유로 Snow Leopard에서 작동하지 않아야합니다. –

3
#ifndef NSAppKitVersionNumber10_5 
#define NSAppKitVersionNumber10_5 949 
#endif 
if(NSAppKitVersionNumber>NSAppKitVersionNumber10_5) 
{ 
    NSAlert *alert = [NSAlert alertWithMessageText:@"Failed OS check" 
    defaultButton:NSLocalizedString(@"OK", @"") 
    alternateButton:nil otherButton:nil 
    informativeTextWithFormat: 
    @"I am a hard up developer that cannot afford to keep up with my 
    customers. If only they would buy more of my apps i could afford 
    maybe a new mac mini with Snow Leopard on it and bring my 
    App upto date. The problem is that unless i can bring my 
    app upto date i am not likely to get many customers at all. 
    If you know how that film with Art Garfunkel ended could 
    you please let me know."]; 
    [alert runModal]; 
} else { 
// start up app 
} 

* (감사 에이디 엄)

+0

아, 이미 물어 봤지만 벌써 대답 해 줬습니다. –

관련 문제