objective c - iOS 9.0 - NSMutableDictionary causing EXC_BAD_ACCESS -


my application includes singleton class represents general data. latter contains following atomic property :

// .h file @property (atomic, strong) nsmutabledictionary *datadictionary;  // .m file @synthesize datadictionary; 

the dictionary being used simultaneously different threads (both setter , getter), , worked normal without crashes on ios 6.0 - 8.4. have run application on ios 9.0 simulator , crashed (exc_bad_access) in arbitrary code calling dictionary setobject:forkey: method.

  1. does knows have changed in ios 9.0 can cause crashes ?
  2. any clue how solve issue ?

enter image description here

enter image description here

atomic on property doesn't mean think does. atomic means property value (i.e. pointer) protected parallel access, doesn't protect contents of dictionary @ all.

if code worked on previous versions of ios, fluke. code crash randomly if allowing multiple threads access single nsmutabledictionary in way.

you need add locking discipline of sort between these multiple threads.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -