I'm aware that scanf() can be used when you know what data type the user will input. What if that information is unknown, and you would like to be able to handle any type? Is there an easy way to accomplish this?
i.e. assuming some class whichClass and function genericScan()
int main(int argc, const char * argv[]){
whichClass *entry = [[whichClass alloc]init];
genericScan(&entry);
if(entry.isDouble())
NSLog(@"You entered a double!");
else if(entry.isFloat())
NSLog(@"You entered a float!");
else if(entry.isInteger())
NSLog(@"You entered an integer!");
else if (entry.isChar())
NSLog(@"You entered a char!");
else
NSLog(@"Unknown data type!");
return(0);
}