CPU Maxed out Memory Crash with TWTRLogInButton (iOS)


#1

Hey all,

I set up Fabric and installed TwitterKit. Put in a TWTRLogInButton as per the fabric installation walkthrough. The button works as expected except for one big problem. Every time I press it, the memory and cpu on my app jump up uncontrollably until the app crashes due to lack of memory some time during or after authentication with twitter depending on how fast you go through it.

Anyone else have this issue?

HALP!

-Neil


#2

Fixed!

For those who are curious. It seems like TwitterKit is using core data under the covers. Well since I’m using core data and was merging contexts blindly, I was trying to merge twitter’s model into my own at some point! Doh. So the fix is to specify the context when you register for the ContextDidSave notification (as per app docs 0.o). I had specified nil which gets notified on every context change.

Shoutout to the profiler for helping debug this. I would be nothing without you!

Cheers!

Neil


#3