In my Project, I create a String with various different variables and then insert it into my subtitles. The Simulator shows it spot on. Yet on the IPad it shows NULL in the case of just one variable and not any other. Has anybody ever experienced a similar problem?
As I am unable to post Images (not enough reputation so far) I simply have to reconstruct it by typing it down:
IOS Simulator:
................................................................
Thomas Winter
2014-01-05 - Dauer:0,5 h
................................................................
Real Device:
................................................................
Thomas Winter
2014-01-05 - Dauer:(null) h
................................................................
The String is beeing put together by using a initStringWithFormat method, in which I include the variables. Seeing how the h is still there in the subtitle but noch the Duration before it, I can only think that the variable is defunct on the actual device
NSNumberFormatter * formatter = [[NSNumberFormatter alloc]init];
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
[formatter setMaximumFractionDigits:2];
NSString * dauerString =[[NSString alloc]initWithFormat:@"Dauer: %@h",[formatter numberFromString:[[self.leistungListe objectAtIndex:indexPath.row]getDauer]]];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"YYYY-MM-dd"];
NSString * dateString = [dateFormat stringFromDate:[[self.leistungListe objectAtIndex:indexPath.row]getDatum]];
NSString * detailTextString = [[NSString alloc]initWithFormat:@"%@ - %@",dateString,dauerString];
cell.detailTextLabel.text =detailTextString;