문제

I handle a lot of time stamps that I store as NSTimeInterval.

NSDateComponents* comps = [[NSDateComponents alloc] init];
[comps setYear: ....
NSDate* date = [gregorian dateFromComponents:comps];
NSTimeInterval timeStamp = [date timeIntervalSinceReferenceDate];

Interface Builder has a table view binding to the variable of the time stamp. How can I format the (double value of) NSTimeInterval into a human readable date format? The Interface Builder Table Column Bindings palette has a input field Value Transformer - can I do something here?

도움이 되었습니까?

해결책

The trick is to drag and drop NSDateFormatter from the Library panel to the table view cell.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top