开发者

Objective-C using NSRunningApplication terminate, to quit iTunes

I want to quit iTunes from my app, this is the code i have so far, but i get the error NSRunningApplication -undeclared.

if ([closeiTunes state] == NSOnState) {
    [[NSRunningApplication runningApplicationsWithBundleIdentifier:@"co开发者_StackOverflowm.apple.iTunes"] objectAtIndex:0] terminate];
}

Can anyone help? Thanks.


NSRunningApplication is a class that is only available in the 10.6 SDK. Set the Base SDK to Mac OS X 10.6 and there should be no problems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜