zoukankan      html  css  js  c++  java
  • 写入缓存了,可是 删除项目 还是 0,原来 又修改了,

     

     

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

    {

      

        becomeActiveFirst = YES;

        [selfinitLocalNotification];

        self.savedOptions = launchOptions;

        trueNumber = [[TTCacheUtilobjectFromFile:@"trueNumber.plist"]intValue];

        [application registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound];

        self.window = [[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]];

        // Override point for customization after application launch.

        self.home = [[HomeViewControlleralloc] init];

        self.navigationController = [[CommonNaviControlleralloc] initWithRootViewController:self.home];

        self.window.rootViewController = self.navigationController;

        [self.windowmakeKeyAndVisible];

        if (!self.user) {

            [self showLogin];

        }

        returnYES;

    }

    //home页面加载调用

    -(int)badgeNumberForLocalNotification

    {

        shouldNumber = 0;

        for (int i=0; i<[totalNotificationArray count]; i++) {

            NotificationItem *item=[totalNotificationArrayobjectAtIndex:i];

            int period = [self changeToMinisecond:item.time];

            if (period < 0) {//小于现在的这个时刻

                shouldNumber ++;

            }

        }

        TTLog(@"应被点入的通知个数 %d",shouldNumber);

        if ([selfnextDayIsComing]) {

            shouldNumber = trueNumber = 0;

            [TTCacheUtilwriteObject:[NSStringstringWithFormat:@"%d",trueNumber] toFile:@"trueNumber.plist"];

     

        }

        returnshouldNumber - trueNumber;

    }

     

    //进入提醒页面时调用

    -(void)cleanAndSaveNotificationNubmer:(id)sender

    {

        trueNumber = shouldNumber;

        [TTCacheUtilwriteObject:[NSStringstringWithFormat:@"%d",trueNumber] toFile:@"trueNumber.plist"];

     

    }

  • 相关阅读:
    sap快捷登录
    转载(略有修改):Windows 8的承载网络设置方法(w8 创建无线网络/ap)
    转载:Keytool 工具介绍
    minecraft初探
    linux图像界面连接-xdm
    经典的始终经典(牛蛙)
    vmware install win8 and server2012 problem
    windows硬盘优化篇
    网络15软工个人作业5——软件工程总结
    个人作业4——alpha阶段个人总结
  • 原文地址:https://www.cnblogs.com/guligei/p/3198468.html
Copyright © 2011-2022 走看看