Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor [EyeTunes isRunning] to be much simpler

  • Loading branch information...
commit 90eddc8e6650f8bcd7f04f2a23f67029237af887 1 parent 0fca137
@clee clee authored
Showing with 1 addition and 11 deletions.
  1. +1 −11 ETEyeTunes.m
View
12 ETEyeTunes.m
@@ -67,17 +67,7 @@ + (void)quit{
}
+ (BOOL)isRunning{
- //TODO: It is strongly suggested that you use the NSWorkspace runningApplications method and the NSRunningApplication class to retrieve this information in applications targeted for Mac OS X v10.6 and later.
- NSInteger i;
- NSArray *apps = [[NSWorkspace sharedWorkspace] launchedApplications];
- for(i=0; i<[apps count]; ++i){
- NSDictionary *app = [apps objectAtIndex:i];
- NSString *bundleIdentifier = [app objectForKey:@"NSApplicationBundleIdentifier"];
- if([bundleIdentifier isEqualToString:@"com.apple.iTunes"]){
- return YES;
- }
- }
- return NO;
+ return ([[NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.apple.iTunes"] count] > 0);
}
#pragma mark -
Please sign in to comment.
Something went wrong with that request. Please try again.