我试图通过序列化数组将一组“员工”对象 iPhone 传递给 Apple Watch:
NSData *encodedObject = [NSKeyedArchiver archivedDataWithRootObject:employees];
并将其反序列化为在 Watch 端:
NSMutableArray *employees = [NSKeyedUnarchiver unarchiveObjectWithData:encodedObject];
这是“员工”类:
@interface Employee : NSManagedObject
@property (nonatomic, retain) NSNumber * employeeID;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSNumber * age;
@property (nonatomic, retain) NSString * address;
@property (nonatomic, retain) NSString * designation;
@property (nonatomic, retain) NSString * teamName;
@property (nonatomic, retain) NSString * gender;
@property (nonatomic, retain) NSNumber * dateOfJoining;
@end
我是否必须在 Watch 端进行任何更改才能修复此错误?