Put a breakpoint after NSString* clientID = (NSString*)[responseObject objectForKey:@"clientId"];check on debugger if clientID is actually a NSString or you are just forcing a cast on a NSNumber
– LeonardoFeb 7 at 16:30

2 Answers
2

Your error is telling you that the response included a numeric value for client ID (and is represented in the responseObject as a NSNumber; NSCFNumber is part of the broader NSNumber class cluster). It would appear that your JSON response included something like:

{
...,
"clientId": 42
}

rather than

{
...,
"clientId": "42"
}

Rather than focusing on how to convert this NSNumber to a NSString, I would instead be inclined to consider changing client ID throughout the app to be a NSInteger (or a NSNumber). If these IDs are really numeric values, it's best to have a type that reflects that.