Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
402 views
in Technique[技术] by (71.8m points)

ios - Error _BSMachError: (os/kern) invalid capability (20) after receiving remote notification on CloudKit record addition

When I receive a remote notification on a record addition (didReceiveRemoteNotification called), I get the following error message:

_BSMachError: (os/kern) invalid capability (20)

I've already tried to find out more about this in forums and via Google but I could not find any helpful advice that applies to my situation.

What does the error message mean? What can I do about it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I just experienced this error. I was in a UIAlert Action block; when the block exited the error occurred (BTW the parent UIAlertViewController was created in a dispatch_async block so was I guess off main thread.

Anyway, I wrapped the action code itself in

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

       [self handleActionForElement:thisType];



    });

and error went away. Your mileage may vary!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...