Closed yyks999 closed 1 year ago
`- (instancetype)initWithCoder:(NSCoder *)coder{ return [self init]; }
暂时注释掉了UITextInputTraits+QMUI.m中的这段代码,注释后回调正常执行
OverrideImplementation([inputClasses class], @selector(initWithCoder:), ^id(__unsafe_unretained Class originClass, SEL originCMD, IMP (^originalIMPProvider)(void)) {
return ^UIView<UITextInputTraits> *(UIView<UITextInputTraits> *selfObject, NSCoder *firstArgv) {
// call super
UIView<UITextInputTraits> * (*originSelectorIMP)(id, SEL, NSCoder *);
originSelectorIMP = (UIView<UITextInputTraits> * (*)(id, SEL, NSCoder *))originalIMPProvider();
UIView<UITextInputTraits> * result = originSelectorIMP(selfObject, originCMD, firstArgv);
result.qti_didInitialize = YES;
return result;
};
});
没遇到你说的问题。
没有遇到你说的问题。
CNMutableContact *newContact = [[CNMutableContact alloc] init];
newContact.givenName = @"张三";
// 创建一个可变数组来存储号码
NSMutableArray *phoneNumbers = [NSMutableArray array];
// 创建第一个号码
CNPhoneNumber *phoneNumber1 = [[CNPhoneNumber alloc] initWithStringValue:@"1234567890"];
CNLabeledValue *phoneNumberValue1 = [CNLabeledValue labeledValueWithLabel:CNLabelPhoneNumberMain value:phoneNumber1];
[phoneNumbers addObject:phoneNumberValue1];
// 创建第二个号码
CNPhoneNumber *phoneNumber2 = [[CNPhoneNumber alloc] initWithStringValue:@"9876543210"];
CNLabeledValue *phoneNumberValue2 = [CNLabeledValue labeledValueWithLabel:CNLabelPhoneNumberMobile value:phoneNumber2];
[phoneNumbers addObject:phoneNumberValue2];
// 创建第三个号码
CNPhoneNumber *phoneNumber3 = [[CNPhoneNumber alloc] initWithStringValue:@"5555555555"];
CNLabeledValue *phoneNumberValue3 = [CNLabeledValue labeledValueWithLabel:CNLabelPhoneNumberHomeFax value:phoneNumber3];
[phoneNumbers addObject:phoneNumberValue3];
newContact.phoneNumbers = phoneNumbers;
CNContactViewController *vc = [CNContactViewController viewControllerForNewContact:newContact];
vc.allowsEditing = YES;
vc.allowsActions = YES;
vc.delegate = self;
vc.displayedPropertyKeys = @[CNContactGivenNameKey,
CNContactPhoneNumbersKey,
CNContactOrganizationNameKey,
CNContactDepartmentNameKey,
CNContactJobTitleKey,
CNContactNoteKey,
CNContactPostalAddressesKey,
CNContactInstantMessageAddressesKey
];
self.contactVC = vc;
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
vc.navigationItem.leftBarButtonItems = @[[[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemDone target:self action:@selector(dismissContactsViewController)]];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:nav animated:YES completion:nil];
添加多个号码就会出现,只添加一个不会。 不单单是号码,像一些社交信息也一样,加一个没事,多个就不行了。这是个bug,希望能解决掉。
Bug 表现 集成QMUI后,调起CNContactViewController进行联系人编辑,点击右上方“完成”按钮后,didCompleteWithContact回调不执行
截图
![Xnip2022-01-21_17-34-55](https://user-images.githubusercontent.com/4744650/150503186-6c9a264d-9213-484b-b8c0-abe693f4b3a7.png)
如何重现
其他信息
使用QMUIDemo复现,复现代码: QMUIDemo_iOS4.4.2-master.zip