Question: I have a dictionary with an NSNumber in it and I'd like to convert it into NSInteger. Is the simplest/shortest way to do this is to typecast into NSNumber and then calling integerValue? Like so:

```
// newQuestion is an NSDictionary defined somewhere
NSInteger questionId = [(NSNumber *)[newQuestion objectForKey:@"question_id"] integerValue];

```

Is there a better way to do this? Thanks!

Answer: 
You can get rid of the cast if you want to make it shorter:

```
// newQuestion is an NSDictionary defined somewhere
NSInteger questionId = [[newQuestion objectForKey:@"question_id"] integerValue];

```

Since `objectForKey:` returns `id`, you can send it any known message and the compiler won't complain.
Nope. That is the way to go. The question, though, is why do you need to turn into an integer in the first place? That may be avoidable. Or not.