开发者

Objective-C using NSRunningApplication terminate, to quit iTunes

开发者 https://www.devze.com 2023-02-20 05:20 出处:网络
I want to quit iTunes from my app, this is the code i have so far, but i get the error NSRunningApplication -undeclared.

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

精彩评论

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