On Dec 14, 2008, at 6:35 AM, John Love wrote:
BOOL ExcelActive = NO;
NSWorkspace *workSpace;
NSArray *runningAppDictionaries;
NSDictionary *aDictionary;
workSpace = [NSWorkspace sharedWorkspace];
runningAppDictionaries =
On Dec 13, 08, at 12:21 PM, Jean-Daniel Dupas wrote:
Because operator overriding does not exists in Obj-C and so, == is a
pointer comparaison and not a string comparaison.
use the isEqual: method to compare two object.
Thanks to everyone who chimed in .. and here are my changes:
I do not understand why this code completes with the specified
application not being active .. when it really is? I really need your
help.
BOOL AppActive = NO;
NSWorkspace *workSpace;
NSArray *runningAppDictionaries;
NSDictionary *aDictionary;
Le 13 déc. 08 à 18:14, John Love a écrit :
I do not understand why this code completes with the specified
application not being active .. when it really is? I really need
your help.
BOOL AppActive = NO;
NSWorkspace *workSpace;
NSArray
Specifically, in his case, wouldn't it be:
aDictionary valueForKey:@NSApplicationName] isEqualToString:
@MyApplication
?
Quoting Jean-Daniel Dupas devli...@shadowlab.org:
Le 13 déc. 08 à 18:14, John Love a écrit :
I do not understand why this code completes with the specified
Yes, you can use this variant in this case, but the result will be the
same.
Quote from isEqualToString: documentation
«When you know both objects are strings, this method is a faster way
to check equality than isEqual:»
Le 13 déc. 08 à 18:41, jmun...@his.com a écrit :
Specifically,
On Sat, Dec 13, 2008 at 12:14 PM, John Love jote...@charter.net wrote:
if ([aDictionary valueForKey:@NSApplicationName] == @My
Application) {
In addition to what the others have said, you should be checking the
bundle ID if at all possible, not the name. A bundle ID is (intended