Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug info when run today extension

Got this debug info when debug a today extension app

"host connection < NSXPCConnection: 0x170113560 > connection from pid 53 invalidated"

does anyone know what this means? it shows almost every time when "widgetPerformUpdateWithCompletionHandler" called.

like image 855
Bobo Shone Avatar asked Nov 19 '14 08:11

Bobo Shone


People also ask

How do I debug a current extension?

You can debug you Today Extension by doing the following: With the application running in your device/simulator, open the widget. Then, when you have your widget open, go to Xcode->Debug->Attach to Process and you should find your widget name. Note this will only work if you have your widget opened.

How do I debug a widget extension?

To debug your widget, select the widget-extension target in Xcode and choose Product > Run.


1 Answers

NSXPCConnection API is used to perform interprocess connection between Xcode client and your app on iPhone. So you do not need to worry about this one.

Link: https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingXPCServices.html

So there may be 2 reasons that your widget is terminated.

  1. You need to call completionHandler(NCUpdateResultNoData); right after your widgetPerformUpdateWithCompletionHandler has been called even when the response hasn't been returned.

  2. Your app is terminated because of the automatic app termination. It terminates the widgets/apps for 2 reasons:

a. It terminates apps that are not being used and allowing the reclamation of resources such as memory.

b. It terminates widgets that use too much memory.

like image 73
bllakjakk Avatar answered Sep 23 '22 04:09

bllakjakk