-2

I'm having trouble to remove all the local notifications using a UIButton on the Apple Watch. In the iPhone app everything works fine, but when I use the same code for the Apple Watch it won't work.

This is the code I use for the Apple Watch:

[[UIApplication sharedApplication] cancelAllLocalNotification];

What do I do wrong?

AstroCB
  • 12,337
  • 20
  • 57
  • 73

2 Answers2

0

Looks like you forgot the "s" on "cancelAllLocalNotification".

intcreator
  • 4,206
  • 4
  • 21
  • 39
0

Basically you can not call UIApplication on the WatchKit extension because is not part of WatchKit framework.

Give a look at : WKInterfaceController.openParentApplication

That will allow you to communicate with the AppDelegate of your main app like this you can call your method.

ant_one
  • 845
  • 11
  • 11