// STRING TO NUMBER
NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
if ([[myDict valueForKey:@"faxSent"] isKindOfClass:[NSString class]])
NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
[f setNumberStyle:NSNumberFormatterDecimalStyle];
if ([[myDict valueForKey:@"faxSent"] isKindOfClass:[NSString class]])
{
NSString* hasFaxBeenSent = [myDict valueForKey:@"faxSent"];
hasFaxBeenSentNumber = [f numberFromString:hasFaxBeenSent];
}
else if ([[myDict valueForKey:@"faxSent"] isKindOfClass:[NSNumber class]])
{
hasFaxBeenSentNumber = [myDict valueForKey:@"faxSent"];
}
// NUMBER TO STRING
// NUMBER TO STRING
if ([[myDict objectForKey:@"emailAddressExists"] isKindOfClass:[NSString class]])
{
emailAddressExists = [myDict objectForKey:@"emailAddressExists"];
}
else if ([[myDict objectForKey:@"emailAddressExists"] isKindOfClass:[NSNumber class]])
{
emailAddressExistsNumber = [myDict valueForKey:@"emailAddressExists"];
emailAddressExists = [emailAddressExistsNumber stringValue];
}
No comments:
Post a Comment