"Terminated due to memory issue"

I am getting constant and seemingly random crashes in my NotificationService app extension. This is my first app extension so I'm not sure how debugging normally works, but my exceptions breakpoint is not getting triggered. The extension just exits and the default notification goes through. I've been able to track down specific spots where the extension crashes using line breakpoints and simply stepping through until it crashes. The odd thing is that it will consistently crash on the same exact line every time (so it doesn't seem to be a memory pressure issue). I can't find any ryhm or reason behind any of this. Here are a few examples of crashes:


  • for key in dict.keys {} but not for (key, _) in dict {}.
  • dateFormatter.date(from:) but not just dateFormatter.
  • attributes.count wher attributes is a custom struct.

So it looks like everything works on my iPhone 6, but not my iPhone 6s Plus or iPad Air 2.

This is driving me insane.


existingObjects.insert(newObject, at: 0) crashes but not existingObjects.append(newObject).


The only information I can find on this is either a bug in some Pokemon Go hack or people saying it is an out of memory error. Any tool I try to use to debug this only makes the problem go away.

"Terminated due to memory issue"
 
 
Q