Ray Zhang hace 11 años
padre
commit
f77c7ea659

+ 1 - 1
Apex Mobile/Apex Mobile/ApexMobileNetwork.h

@@ -16,7 +16,7 @@
 #import "DetailContent.h"
 #import <MessageUI/MessageUI.h>
 #import <MessageUI/MFMailComposeViewController.h>
-#define TEST
+//#define TEST
 @interface ApexMobileNetwork : NSObject
 +(void)Logout ;
 +(int)Authorize : (NSString*) user password:(NSString*) password ;

+ 10 - 2
Apex Mobile/Apex Mobile/ApexMobileNetwork.m

@@ -140,9 +140,17 @@
         NSString* required_ver=[objheader objectForKey:@"client_ver"] ;
         DebugLog(@"required_ver=%@ ",required_ver);
         NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
-        NSString* versionNum =[infoDict objectForKey:@"CFBundleVersion"];
+        NSString* versionNum =[infoDict valueForKey:@"CFBundleVersion"];
         versionNum = [NSString stringWithFormat:@"A%@",versionNum];
-        app.applicationIconBadgeNumber = [[objheader valueForKey:@"badge" ] intValue];
+        int ibadge = [[objheader valueForKey:@"badge"] intValue];
+        
+//        if([ibadge isEqual:[NSNull null]])
+//            strbadge=@"0";
+//        if(ibadge==nil)
+//            ibadge=@"0";
+//        if([strbadge isEqualToString:@"null"])
+//            strbadge=@"0";
+        app.applicationIconBadgeNumber = ibadge;//[strbadge intValue];
         
         BOOL bigger = [versionNum compare:required_ver] ;
         if(!bigger)