I'm iterating through an array of numbers that come through an API call:

[6000, 6001, 2000] for example

Here's my code:

```
    for(NSNumber* arrayID in array){                               
        NSManagedObject *ent = [NSEntityDescription insertNewObjectForEntityForName:@"Genre" inManagedObjectContext:self.managedObjectContext];
        [ent setValue:arrayID forKey:@"genreID"]; 
        [ent setValue:name forKey:@"genreName"];
        [mySet addObject:ent];
    }

```

When setting the arrayID (which is NSNumber in my core data), I get a crash:

```
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for attribute: property = "genreID"; desired type = NSNumber; given type = __NSCFString; value = 6002.'

```

It's as if arrayID has not been cast as an NSNumber? Xcode says its an NSNumber when I type it in, but if I put [arrayID doubleValue] for example, Xcode tells me that 'doubleValue cannot be sent for type 'id'

Any ideas?