no output from NSDateFormatter stringFromDate
devsnek opened this issue · comments
snek commented
my code is as follows:
const $ = require('nodobjc');
$.import('Foundation');
const pool = $.NSAutoreleasePool('alloc')('init');
const dateFormatter = $.NSDateFormatter('alloc')('init');
dateFormatter.dateStyle = $.NSDateFormatterMediumStyle;
dateFormatter.timeStyle = $.NSDateFormatterMediumStyle;
dateFormatter.locale = $.NSLocale('alloc')('initWithLocaleIdentifier', $('en_US'));
const date = $(new Date());
console.log(dateFormatter.methods());
$.NSLog($("%@"), dateFormatter('stringFromDate', date));
pool('release');
the $.NSLog
never seems to run, did i do something stupid?
snek commented
$.NSDateFormatter(
'localizedStringFromDate', date,
'dateStyle', $.NSDateFormatterMediumStyle,
'timeStyle', $.NSDateFormatterMediumStyle,
)
solved my problem