Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fealonelei opened this issue Jul 5, 2014 · 0 comments
Open

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

fealonelei opened this issue Jul 5, 2014 · 0 comments

Comments

@fealonelei
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant