I am trying to get a hit on my if-statement. I fetch qDiff (integer32) from the Core Data db and everything works except get a hit on the if-statements:

```
NSString *diff;

NSArray *fetchedObjects = [qContext executeFetchRequest:fetchRequest error:&error];
for (NSManagedObject *info in fetchedObjects) {
    NSLog(@"idQ: %@", [info valueForKey:@"idQ"]);
    NSLog(@"qDiff: %@", [info valueForKey:@"qDiff"]); //<<<<<<<<<Print correct number

    diff = [info valueForKey:@"qDiff"];
    NSLog(@"diff: %@", diff);       //<<<<<<<<<Print correct number

    if ([diff isEqual:@"1"]) NSLog(@"EASY");

    //if ([diff isEqualToString: @"2"]) NSLog(@"MEDIUM");
    //if ([[info valueForKey:@"qDiff"] isEqualToString: @"3"]) NSLog(@"HARD"); //<<<<<<tried this first

    NSLog(@"question: %@", [info valueForKey:@"question"]);
}        
[fetchRequest release];      

```

I have been trying different If-statements but it does not trigger (print the NSLog).

Anyone that can give me a hint? 

**=========UPDATE==========**

I changed to:

```
if ([diff isEqualToString:@"1"]) NSLog(@"EASY");

```

And got the following:

> 
> 2010-12-12 15:39:49.321 XX\_v2[2950:207] idQ: 0  
> 
>  2010-12-12 15:39:49.321 XX\_v2[2950:207] qDiff: 1  
> 
>  2010-12-12 15:39:49.322 XX\_v2[2950:207] diff: 1  
> 
>  2010-12-12 15:39:49.322 XX\_v2[2950:207] -[\_PFCachedNumber isEqualToString:]: unrecognized selector sent to instance 0xa0f9008  
> 
>  2010-12-12 15:39:49.324 XX\_v2[2950:207] *\** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[\_PFCachedNumber isEqualToString:]: unrecognized selector sent to instance 0xa0f9008'
> 
> 
> 

**==========UPDATE #2=======**

Did try:

```
if ([diff isEqual:@"1"]) NSLog(@"EASY");

```

no difference in output:

> 
> 2010-12-12 15:55:57.381 XX\_v2[3151:207] idQ: 0  
> 
>  2010-12-12 15:55:57.382 XX\_v2[3151:207] qDiff: 1  
> 
>  2010-12-12 15:55:57.382 XX\_v2[3151:207] diff: 1  
> 
>  2010-12-12 15:55:57.382 XX\_v2[3151:207] question: Do you want a new?
> 
> 
> 

However, in the debugger i found:

> 
> 'diff' "Variable not a CFString"
> 
> 
> 

**========UPDATE#3========**

Updated the code above to show definition of 'diff'.

**========UPDATE#4========**

I did finally solve the problem with this statement:

```
if ([[info valueForKey:@"qDiff"] intValue] == 1) NSLog(@"EASY");

```