objective c - Create NSDate from Unix timestamp -


how create nsdate unix timestamp?

channel.startdate = [nsdate datewithtimeintervalsince1970: (nstimeinterval)[channeljson objectforkey:@"broadcaststartedtime"]]; 

i error:

104: error: pointer value used floating point value expected

channels.startdate nsdate*. value key "broadcaststartedtime" javascript number converted nsnumber or nsdecimalnumber sbjson parser library.

try instead:

nsnumber *starttime = channeljson[@"broadcaststartedtime"]; channel.startdate = [nsdate datewithtimeintervalsince1970:[starttime doublevalue]]; 

your value trapped in pointer type of nsnumber. datewithtimeintervalsince1970 method expecting primitive nstimeinterval (which, under covers, double).


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -