zoukankan      html  css  js  c++  java
  • fmdb

    #if SQLITE_VERSION_NUMBER >= 3007017
    
    - (uint32_t)applicationID {
        
        uint32_t r = 0;
        
        FMResultSet *rs = [self executeQuery:@"pragma application_id"];
        
        if ([rs next]) {
            r = (uint32_t)[rs longLongIntForColumnIndex:0];
        }
        
        [rs close];
        
        return r;
    }
    
    - (void)setApplicationID:(uint32_t)appID {
        NSString *query = [NSString stringWithFormat:@"pragma application_id=%d", appID];
        FMResultSet *rs = [self executeQuery:query];
        [rs next];
        [rs close];
    }
    
    
    #if TARGET_OS_MAC && !TARGET_OS_IPHONE
    - (NSString*)applicationIDString {
        NSString *s = NSFileTypeForHFSTypeCode([self applicationID]);
        
        assert([s length] == 6);
        
        s = [s substringWithRange:NSMakeRange(1, 4)];
        
        
        return s;
        
    }
    
    - (void)setApplicationIDString:(NSString*)s {
        
        if ([s length] != 4) {
            NSLog(@"setApplicationIDString: string passed is not exactly 4 chars long. (was %ld)", [s length]);
        }
        
        [self setApplicationID:NSHFSTypeCodeFromFileType([NSString stringWithFormat:@"'%@'", s])];
    }
    
    
    #endif
    
    #endif
  • 相关阅读:
    招行面试
    今日头条面试[教育岗]
    四方精创 面试
    ArrayList 源码
    redis缓存,穿透,击穿,雪崩
    hashMap
    集合整理
    阿里CBU技术部一面
    网安面试
    php递归获取顶级父类id
  • 原文地址:https://www.cnblogs.com/javastart/p/4903418.html
Copyright © 2011-2022 走看看