As a more general answer, try using the hasPrefix method. For example, the code below checks to see if a string begins with 10, which is the error code used to identify a certain problem.
NSString* myString = @"10:Username taken";
if([myString hasPrefix:@"10"]) {
//display more elegant error message
}