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.
精彩评论