WhoCall icon indicating copy to clipboard operation
WhoCall copied to clipboard

Don't allow access to contracts, it will crash

Open fealonelei opened this issue 10 years ago • 0 comments

Hi, xiaolei. When I have this app on my iphone 5s,which is ios7.1.1,If I don't allow it access to my contracts,it will crash. Xcode give a hint of "bad access " in line60,WCAddessBook.m.which code is "CFIndex numberOfPeople = CFArrayGetCount(allPeople);"
I give a solution that I add a few line code in front of it : if (allPeople == nil) { return; } and,I comment all code except "break;" at the end in "case kABAuthorizationStatusDenied:" in line80,WCSettingViewController.m. It "seems" working good.However, I haven't test it seriously. So,will you do such thing to make it perfect,please ?
Thanks! //------------------------------------------------------------------------------------ 你好,小磊。当我在跑ios7.1.1的iPhone 5s上测试,如果不允许访问通讯录,程序就会崩溃。Xcode报“bad access”错误,错误在WCAddessBook.m的60行-- "CFIndex numberOfPeople = CFArrayGetCount(allPeople);" 原因可能就是发送了nil给它。 我在这一行前面加了
if (allPeople == nil) { return; } 并且在WCSettingViewController.m里将80行的“case kABAuthorizationStatusDenied:”除了最后的“break;”全部注释。 即使在隐私里设置不允许访问通讯录,它看上去就可以用了。我还没有做更多的测试,也许会有其他问题,还请你指出。
我认为允不允许访问通讯录是个人选择,像我这样,即使使用耳机接电话,也会掏出手机来看看的人,语音播报联系人姓名意义不大。 如果有其他问题,还请不吝指教。谢谢

fealonelei avatar Jul 05 '14 06:07 fealonelei