Skip to content

Don't allow access to contracts, it will crash  #16

Description

@fealonelei

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;”全部注释。
即使在隐私里设置不允许访问通讯录,它看上去就可以用了。我还没有做更多的测试,也许会有其他问题,还请你指出。
我认为允不允许访问通讯录是个人选择,像我这样,即使使用耳机接电话,也会掏出手机来看看的人,语音播报联系人姓名意义不大。
如果有其他问题,还请不吝指教。谢谢

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions