NSString *depositOverTotalRwy = [NSString stringWithFormat:@"%@", [deposit text]];
NSArray *components = [depositOverTotalRwy
componentsSeparatedByString:@"/"];
NSString *firstThird = [components objectAtIndex:0];
if ([firstThird isEqualToString: @"1"]) {
NSLog(@"wet");
}
if ([firstThird isEqualToString:@"2"]) {
NSLog(@"snow");
}
if ([firstThird isEqualToString:@"3"]) {
NSLog(@"ice");
}
NSString *secThird = [components objectAtIndex:1];
if ([secThird isEqualToString: @"1"]) {
NSLog(@"wet");
}
if ([secThird isEqualToString:@"2"]) {
NSLog(@"snow");
}
if ([secThird isEqualToString:@"3"]) {
NSLog(@"ice");
}
NSString *thirdThird = [components objectAtIndex:2];
if ([thirdThird isEqualToString: @"1"]) {
NSLog(@"wet");
}
if ([thirdThird isEqualToString:@"2"]) {
NSLog(@"snow");
}
if ([thirdThird isEqualToString:@"3"]) {
NSLog(@"ice");
}
dep.text = [NSString stringWithFormat:@"%@ over %@ over %@", firstThird, secThird, thirdThird];
Hi guys, I have a problem. when I set the label (dep.text), I get the number instead of wet, snow or ice. it works in the console (NSlog). I know it must be some error in the logic but i'm not able to find it. Thanks in advance.
[deposit text].