Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"host connection <NSXPCConnection: 0x538ee0> connection from pid 42 invalidated" for iOS Today widget

I'm working on an iOS today widget and things are quite functional. However, when running on a real iOS device I occasionally see: host connection <NSXPCConnection: 0x538ee0> connection from pid 42 invalidated

This doesn't seem to be a major problem except that the widget seems to almost reload when this happens, occasionally leaving the space in the Today screen blank until iOS redraws it and everything gets reloaded.

Has anyone else encountered this? I'm not using NSXPCConnection at all in my App, so I'm assuming this is something built into the framework but I'm not sure

like image 948
ryno2019 Avatar asked Jan 05 '15 22:01

ryno2019


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 180
bllakjakk Avatar answered Oct 28 '22 23:10

bllakjakk