zoukankan      html  css  js  c++  java
  • iOS开发错误:Attempting to badge the application icon but haven't received permission from the user to badge the

    UIApplication *app =[UIApplication sharedApplication];   

     app.applicationIconBadgeNumber=10;

    错误:

    Attempting to badge the application icon but haven't received permission from the user to badge the 

    这是因为iOS8中,设置左面图标数组需要获取权限。 处理方法:

    在第一个函数中添加代码加入

        //   IOS8中,要修改应用的图标需要让用户允许

        UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge categories:nil];

        [[UIApplication sharedApplication] registerUserNotificationSettings:settings];

  • 相关阅读:
    属性选择器
    优先级
    hj_html&css
    hj_解决gpedit.msc不存在的问题
    hj_designPatterns
    hj_ssm
    hj-springmvc
    hj_mybatis
    hj_Python踩坑之旅
    hj_Python学习笔记
  • 原文地址:https://www.cnblogs.com/tate-zwt/p/4385029.html
Copyright © 2011-2022 走看看