Ok so this may sound a bit wired, but I am creating an application/framework that needs to convert XML to its appropriate Data type in an Objective-C class.
[dictionary objectForKey:key]
returns the name of the attribute that is going to be updated, but obviously this a string its self, so the above comparison is always a string. I need the actual class of the attribute and I cant find a way of doing it, anyone have any ideas ?
Code:
if([ [dictionary objectForKey:key] isKindOfClass: [NSString class]]==YES )
{
//Set the variable
}
if([ [dictionary objectForKey:key] isKindOfClass: [NSNumber class]]==YES )
{
//Set the variable
}
[dictionary objectForKey:key]
returns the name of the attribute that is going to be updated, but obviously this a string its self, so the above comparison is always a string. I need the actual class of the attribute and I cant find a way of doing it, anyone have any ideas ?