From AppDelegate i call this:
-(void)application:(UIApplication *)application handleWatchKitExtensionRequest:(NSDictionary *)userInfo reply:(void (^)(NSDictionary *))reply{
[SavedSearchesHack getAllMatches:^(MatchCollection * _Nonnull matchCollection) {
reply(@{@"response" : matchCollection});
}];
}
And then i get this error when calling the reply:
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'This decoder will only decode classes that adopt NSSecureCoding. Class 'Test.MatchCollection' does not adopt it.'
public class func openParentApplication(userInfo: [NSObject : AnyObject],
reply: (([NSObject : AnyObject], NSError?) -> Void)?) -> Bool
As long as i return simply objects like "test" instead of a MatchCollection i get no error.
add in .h
file
// just the protocol
@interface PacketH: NSObject<NSSecureCoding>
add in .m
file
+ (BOOL)supportsSecureCoding {
return YES;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With