How do you implement os_trace_with_payload logs in xcode for sdk iOS 9.3 using the new activity trace log mechanism

os_trace_with_payload is a functin of activity trace log mechanism used which are useful during application crash. This function throws an error for xcode 7.2 and iOS 9.3 ,so could you please guide how to implement the log.


Using Objective-C

eg:

os_trace_with_payload("logged in: %d", guid, ^(xpc_object_t xdict) { xpc_dictionary_set_string(xdict, "name", username); });

Replies

i also have the same issue . can any body help . it shows the error implicit declaration of function.


xcode 8.0

it shows the error implicit declaration of function.

What platform are you working on?

os_trace_with_payload
is a macOS-only thing (if you look in the header you’ll see it’s guarded by
__has_include(<xpc/xpc.h>)
, and XPC is only public API on the Mac).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"