将操作集添加到 HMEventTrigger 时遇到问题。下面是我的代码。任何建议都会非常有帮助。
// Set-up a region
CLLocationDegrees latitude = 17.4411482;
CLLocationDegrees longitude = 78.3910691;
CLLocationCoordinate2D centerCoordinate = CLLocationCoordinate2DMake(latitude, longitude);
CLCircularRegion *region = [[CLCircularRegion alloc] initWithCenter:centerCoordinate
radius:2 // Metres
identifier:@"testLocation"];
region.notifyOnExit = YES;
region.notifyOnEntry = YES;
HMLocationEvent *ev = [[HMLocationEvent alloc] initWithRegion:region];
NSPredicate *pred = [HMEventTrigger predicateForEvaluatingTriggerWithCharacteristic:appDel.selectedCh relatedBy:NSEqualToPredicateOperatorType toValue:appDel.selectedCh.value];
HMEventTrigger *tr2 = [[HMEventTrigger alloc] initWithName:eventName.text events:[NSArray arrayWithObjects:ev,nil] predicate:pred];
HMActionSet *abcd = appDel.selectedHome.actionSets[0];
[tr2 addActionSet:abcd completionHandler:^(NSError *err)
{
}
我在 tr2 addactionset 行遇到了错误的访问问题