How do I create an NSDate from a Unix timestamp?
channel.startDate = [NSDate dateWithTimeIntervalSince1970:
(NSTimeInterval)[channelJson objectForKey:@"broadcastStartedTime"]];
I get this error:
104: error: pointer value used where a
floating point value was expected
channels.startDate
is an NSDate*
. The value for the key "broadcastStartedTime" is a Javascript Number
converted into an NSNumber
or NSDecimalNumber
by the SBJson parser library.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…