ios - NSDateFormatter crashes when used from different threads -


we keep getting random, weird crash nsdateformatter. relevant stack trace is:

program received signal:  “exc_bad_access”. #0  0x00000005 in ?? () #1  0x0213e3c3 in udat_parse () #2  0x01d4e1ca in cfdateformattergetabsolutetimefromstring () #3  0x01d4e225 in cfdateformattercreatedatefromstring () #4  0x003e2608 in getobjectvalue () #5  0x003e2921 in -[nsdateformatter getobjectvalue:forstring:errordescription:] () #6  0x003e21cd in -[nsdateformatter datefromstring:] () 

the date formatter still in memory (i.e. not released or corrupted). thing can think of strings upon crash not conform format, doubt make formatter crash. (it non trivial check format beforehand).

any thoughts?

thanks previous answerers.

this not memory problem. turned out synchronization issue. nsdateformatters not thread safe; there background thread attempting use same formatter @ same time (hence randomness).

hope helps in future!


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -