0

Today Notification Widget launch crashes with the following error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: <__NSConcreteUUID 0x170026460> C492718F-C23C-4FC8-AE0F-ED5CE3141xxx)'

ViewDidLoad not even gets called

Any idea why?

Silviu St
  • 1,810
  • 3
  • 33
  • 42
  • possible duplicate of [Today Extension Crashes before launching on iOS 8.1.2](http://stackoverflow.com/questions/28153273/today-extension-crashes-before-launching-on-ios-8-1-2) – itsji10dra Sep 05 '15 at 13:14

2 Answers2

2

Check if NotificationCenter.framework is included into your project's current selected target or if there is any other framework missing.

itsji10dra
  • 4,603
  • 3
  • 39
  • 59
simina_gb
  • 36
  • 3
  • would it even compile if it were missing? – Daij-Djan Sep 05 '15 at 13:03
  • @Daij-Djan It seemed it was missing inside notification target, after I added it won't crash at run – Silviu St Sep 05 '15 at 13:07
  • @Daij-Djan Tried to add google analytics and admob and it's frameworks and it was selected target from TodayNotificationWidget and after I removed them because I had compile problems I might removed that framework by mistake and after adding it, it didn't crash after launch... – Silviu St Sep 06 '15 at 18:48
1

It sounds like you're trying to write a nil value into a dictionary or NSUserDefaults. Your controller will be initialized before viewDidLoad is called. Did you override the initializer?

I think you need to provide more information. Maybe post your controller code?

Christopher Pickslay
  • 17,523
  • 6
  • 79
  • 92