String Comparison and return values
String Comparison and return values
- Subject: String Comparison and return values
- From: John Ku <email@hidden>
- Date: Tue, 26 May 2009 00:33:42 -0700
I am currently trying to compare two string to see if they're equal to each
other. The two values should be equal but when debugging it's giving me a
false return. What gives?
NSString *itemA = [DictionaryA valueForKey:@"FirstProcessIdentifier"];
NSWorkspace *workSpace = [NSWorkspace sharedWorkspace];
for (NSDictionary *apps in [workSpace launchedApplications]) {
if ( [itemA isEqualTo: [apps valueForKey:
@"NSApplicationProcessIdentifier"]] ) {
NSLog(@"this should run" );
}
}
the NSString "itemA" should contain for example "312" pid
one of the "[apps valueForKey: @"NSApplicationProcessIdentifier"]" should
also return the same "312"
When I NSLog both, there is a matching set "312", but the if statement is
returning false...any tips?
Thanks,
John
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden