IOS 開發(fā) 清理緩存封裝(包括WebKit緩存/SDImageCache緩存)

文章開始前先貼個(gè)圖看下app的沙盒路徑:


網(wǎng)上搜索的清除緩存相關(guān)的文章清一色都有一個(gè)問題,就是只清理/Library/Caches目錄文件,理論上來講是沒錯(cuò),所有的緩存文件都會(huì)放在app沙盒目錄的Caches文件目錄下,這樣的清理模擬器能通過,真機(jī)則會(huì)因?yàn)闆]有Snapshot的訪問權(quán)限而中止清理。
所以實(shí)際應(yīng)用中我們的計(jì)算緩存大小函數(shù),以及清理函數(shù)需要跳過Snapshot這個(gè)文件目錄,不講目錄文件大小計(jì)入緩存大小,清理的時(shí)候跳過該目錄防止中斷。

下面的內(nèi)容引用于:
IOS 開發(fā) Cache文件夾緩存的清理封裝(包括WebKit緩存/SDImageCache緩存),都提供了相應(yīng)的接口.

ClearCachesTool.h

//
//  ClearCachesTool.h
//  demo
//
//  Created by zhouyu on 2016/12/27.
//  Copyright ? 2016年 demo. All rights reserved.
/*
 * 真機(jī)和模擬器下WKWebKit下載的圖片資源緩存路徑不一樣
 * 真機(jī):/Library/Caches/WebKit
 * 模擬器:/Library/Caches/cn.demo.demo/WebKit
 * cn.demo.demo是指APP的Boundle Identifier
 * 真機(jī)清理Cache緩存有坑,Snapshots文件夾無操作權(quán)限,導(dǎo)致清理失敗,提供的方法中已經(jīng)做了過濾處理
 */

#import <Foundation/Foundation.h>

@interface ClearCachesTool : NSObject

#pragma mark - 計(jì)算和清理Cache文件夾總緩存
/*s*
 *  獲取Cache文件夾緩存的總大小(Snapshots除外,沒有權(quán)限獲取)
 *
 *  @param path 要獲取的文件夾 路徑
 *
 *  @return 返回path路徑下文件夾的大小
 */
+ (NSString *)getCacheSize;

/**
 *  獲取Cache文件夾緩存的總大小(Snapshots除外,沒有權(quán)限獲取)
 *  @return 是否清除成功
 */
+ (BOOL)clearCache;
+ (void)readyClearCache;


#pragma mark - 計(jì)算和清理指定路徑文件夾總緩存
/*s*
 *  獲取path路徑下文件夾的大小
 *
 *  @param path 要獲取的文件夾 路徑
 *
 *  @return 返回path路徑下文件夾的大小
 */
+ (NSString *)getCacheSizeWithFilePath:(NSString *)path;

/**
 *  清除path路徑下文件夾的緩存
 *
 *  @param path  要清除緩存的文件夾 路徑
 *
 *  @return 是否清除成功
 */
+ (BOOL)clearCacheWithFilePath:(NSString *)path;

#pragma mark - 計(jì)算和清理WebKit文件夾的WKWebKit總緩存
/*s*
 *  獲取WKWebKit路徑下文件夾的大小
 *  @return 返回WKWebKit路徑下文件夾的大小
 */
+ (NSString *)getWKWebKitCacheSize;

/**
 *  清除WKWebKit路徑下文件夾的緩存
 *  @return 是否清除成功
 */
+ (BOOL)clearWKWebKitCache;



#pragma mark - 計(jì)算和清理SDImageCache--default文件夾的總緩存
/*s*
 *  獲取SDImageCache--default路徑下文件夾的大小
 *  @return 返回WKWebKit路徑下文件夾的大小
 */
+ (NSString *)getSDImageDefaultCacheSize;

/**
 *  清除SDImageCache--default路徑下文件夾的緩存
 *  @return 是否清除成功
 */
+ (BOOL)clearSDImageDefaultCache;


#pragma mark - MAC電腦模擬器下計(jì)算和清理WebKit文件夾的WKWebKit總緩存
/*s*
 *  獲取模擬器下WKWebKit路徑下文件夾的大小
 *  @return 返回WKWebKit路徑下文件夾的大小
 */
+ (NSString *)getSimulatorWKWebKitCacheSize;

/**
 *  清除模擬器下WKWebKit路徑下文件夾的緩存
 *  @return 是否清除成功
 */
+ (BOOL)clearSimulatorWKWebKitCache;

@end

ClearCachesTool.m

//
//  ClearCachesTool.m
//  demo
//
//  Created by zhouyu on 2016/12/27.
//  Copyright ? 2016年 demo. All rights reserved.
//

#import "ClearCachesTool.h"

@implementation ClearCachesTool

#pragma mark - 獲取Cache文件夾大小
+ (NSString *)getCacheSize {
    NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
    NSString *totleSize = [ClearCachesTool getCacheSizeWithFilePath:cachesPath];
    return totleSize;
}

#pragma mark - 刪除Cache文件夾中的緩存
+ (BOOL)clearCache {
    NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
    BOOL isAlreadyClearCache = [ClearCachesTool clearCacheWithFilePath:cachesPath];
    return isAlreadyClearCache;
}
+ (void)readyClearCache {
    BOOL isClearCache = [ClearCachesTool clearCache];
    if (isClearCache) {
        ZYLog(@"清理完畢");
    } else {
        ZYLog(@"清理失敗");
    }
}

#pragma mark - 計(jì)算和清理WebKit文件夾的WKWebKit總緩存
+ (NSString *)getWKWebKitCacheSize {
    NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
    NSString *path = [cachesPath stringByAppendingPathComponent:@"/WebKit"];
    // 獲取“path”文件夾下的所有文件
    NSArray *subPathArr = [[NSFileManager defaultManager] subpathsAtPath:path];
    NSString *filePath  = nil;
    NSInteger totleSize = 0;
    for (NSString *subPath in subPathArr){

        // 1. 拼接每一個(gè)文件的全路徑
        filePath =[path stringByAppendingPathComponent:subPath];
//        ZYLog(@"%@",filePath);
        // 2. 是否是文件夾,默認(rèn)不是
        BOOL isDirectory = NO;
        // 3. 判斷文件是否存在
        BOOL isExist = [[NSFileManager defaultManager] fileExistsAtPath:filePath isDirectory:&isDirectory];
        // 4. 以上判斷目的是忽略不需要計(jì)算的文件
        if (!isExist || isDirectory || [filePath containsString:@".DS"]){
            // 過濾: 1. 文件夾不存在  2. 過濾文件夾  3. 隱藏文件
            continue;
        }
        // 5. 指定路徑,獲取這個(gè)路徑的屬性
        NSDictionary *dict = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
        /**
         attributesOfItemAtPath: 文件夾路徑
         該方法只能獲取文件的屬性, 無法獲取文件夾屬性, 所以也是需要遍歷文件夾的每一個(gè)文件的原因
         */
        // 6. 獲取每一個(gè)文件的大小
        NSInteger size = [dict[@"NSFileSize"] integerValue];
        // 7. 計(jì)算總大小
        totleSize += size;
    }

    //8. 將文件夾大小轉(zhuǎn)換為 M/KB/B
    NSString *totleStr = nil;
    if (totleSize > 1000 * 1000){
        totleStr = [NSString stringWithFormat:@"%.2fM",totleSize / 1000.00f /1000.00f];
    }else if (totleSize > 1000){
        totleStr = [NSString stringWithFormat:@"%.2fKB",totleSize / 1000.00f ];
    }else{
        totleStr = [NSString stringWithFormat:@"%.2fB",totleSize / 1.00f];
    }
    return totleStr;
}

+ (BOOL)clearWKWebKitCache {

    NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
    NSString *path = [cachesPath stringByAppendingPathComponent:@"/WebKit"];
    //拿到path路徑的下一級(jí)目錄的子文件夾
    NSArray *subPathArr = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
    NSString *filePath = nil;
    NSError *error = nil;
    for (NSString *subPath in subPathArr) {
        filePath = [path stringByAppendingPathComponent:subPath];
//        ZYLog(@"%@",filePath);
        if (![filePath containsString:@"/Caches/Snapshots"]) {
            //刪除子文件夾
            [[NSFileManager defaultManager] removeItemAtPath:filePath error:&error];
        }
        if (error) {
            ZYLog(@"%@",error);
            return NO;
        }
    }
    return YES;
}

#pragma mark - 計(jì)算和清理SDImageCache--default文件夾的總緩存
+ (NSString *)getSDImageDefaultCacheSize {
    NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
    NSString *path = [cachesPath stringByAppendingPathComponent:@"/default"];
    // 獲取“path”文件夾下的所有文件
    NSArray *subPathArr = [[NSFileManager defaultManager] subpathsAtPath:path];
    NSString *filePath  = nil;
    NSInteger totleSize = 0;
    for (NSString *subPath in subPathArr){

        // 1. 拼接每一個(gè)文件的全路徑
        filePath =[path stringByAppendingPathComponent:subPath];
//        ZYLog(@"%@",filePath);
        // 2. 是否是文件夾,默認(rèn)不是
        BOOL isDirectory = NO;
        // 3. 判斷文件是否存在
        BOOL isExist = [[NSFileManager defaultManager] fileExistsAtPath:filePath isDirectory:&isDirectory];
        // 4. 以上判斷目的是忽略不需要計(jì)算的文件
        if (!isExist || isDirectory || [filePath containsString:@".DS"]){
            // 過濾: 1. 文件夾不存在  2. 過濾文件夾  3. 隱藏文件
            continue;
        }
        // 5. 指定路徑,獲取這個(gè)路徑的屬性
        NSDictionary *dict = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
        /**
         attributesOfItemAtPath: 文件夾路徑
         該方法只能獲取文件的屬性, 無法獲取文件夾屬性, 所以也是需要遍歷文件夾的每一個(gè)文件的原因
         */
        // 6. 獲取每一個(gè)文件的大小
        NSInteger size = [dict[@"NSFileSize"] integerValue];
        // 7. 計(jì)算總大小
        totleSize += size;
    }

    //8. 將文件夾大小轉(zhuǎn)換為 M/KB/B
    NSString *totleStr = nil;
    if (totleSize > 1000 * 1000){
        totleStr = [NSString stringWithFormat:@"%.2fM",totleSize / 1000.00f /1000.00f];
    }else if (totleSize > 1000){
        totleStr = [NSString stringWithFormat:@"%.2fKB",totleSize / 1000.00f ];
    }else{
        totleStr = [NSString stringWithFormat:@"%.2fB",totleSize / 1.00f];
    }
    return totleStr;
}

+ (BOOL)clearSDImageDefaultCache {

    NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
    NSString *path = [cachesPath stringByAppendingPathComponent:@"/default"];
    //拿到path路徑的下一級(jí)目錄的子文件夾
    NSArray *subPathArr = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
    NSString *filePath = nil;
    NSError *error = nil;
    for (NSString *subPath in subPathArr) {
        filePath = [path stringByAppendingPathComponent:subPath];
//        ZYLog(@"%@",filePath);
        if (![filePath containsString:@"/Caches/Snapshots"]) {
            //刪除子文件夾
            [[NSFileManager defaultManager] removeItemAtPath:filePath error:&error];
        }
        if (error) {
            ZYLog(@"%@",error);
            return NO;
        }
    }
    return YES;
}

#pragma mark - 獲取path路徑下文件夾大小
+ (NSString *)getCacheSizeWithFilePath:(NSString *)path {

    // 獲取“path”文件夾下的所有文件
    NSArray *subPathArr = [[NSFileManager defaultManager] subpathsAtPath:path];
    NSString *filePath  = nil;
    NSInteger totleSize = 0;
    for (NSString *subPath in subPathArr){
//        ZYLog(@"getCacheSize = %@",subPath);
        // 0. 把Snapshots文件夾過濾掉,沒有訪問權(quán)限,否則刪除時(shí)操過200M會(huì)失敗!!!!!!!!
        if (![subPath containsString:@"Snapshots"]) {
            // 1. 拼接每一個(gè)文件的全路徑
            filePath =[path stringByAppendingPathComponent:subPath];
        }
        // 2. 是否是文件夾,默認(rèn)不是
        BOOL isDirectory = NO;
        // 3. 判斷文件是否存在
        BOOL isExist = [[NSFileManager defaultManager] fileExistsAtPath:filePath isDirectory:&isDirectory];
        // 4. 以上判斷目的是忽略不需要計(jì)算的文件
        if (!isExist || isDirectory || [filePath containsString:@".DS"]){
            // 過濾: 1. 文件夾不存在  2. 過濾文件夾  3. 隱藏文件
            continue;
        }
        // 5. 指定路徑,獲取這個(gè)路徑的屬性
        NSDictionary *dict = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
        /**
         attributesOfItemAtPath: 文件夾路徑
         該方法只能獲取文件的屬性, 無法獲取文件夾屬性, 所以也是需要遍歷文件夾的每一個(gè)文件的原因
         */
        // 6. 獲取每一個(gè)文件的大小
        NSInteger size = [dict[@"NSFileSize"] integerValue];
        // 7. 計(jì)算總大小
        totleSize += size;
    }

    //8. 將文件夾大小轉(zhuǎn)換為 M/KB/B
    NSString *totleStr = nil;
    if (totleSize > 1000 * 1000){
        totleStr = [NSString stringWithFormat:@"%.2fM",totleSize / 1000.00f /1000.00f];
    }else if (totleSize > 1000){
        totleStr = [NSString stringWithFormat:@"%.2fKB",totleSize / 1000.00f ];
    }else{
        totleStr = [NSString stringWithFormat:@"%.2fB",totleSize / 1.00f];
    }
    return totleStr;
}

#pragma mark - 清除path文件夾下緩存大小--/Caches/Snapshots,真機(jī)測(cè)試會(huì)輸出error
//Error Domain=NSCocoaErrorDomain Code=513 "未能移除“Snapshots”,因?yàn)槟鷽]有訪問它的權(quán)限。"
+ (BOOL)clearCacheWithFilePath:(NSString *)path{

    //拿到path路徑的下一級(jí)目錄的子文件夾
    NSArray *subPathArr = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
    NSString *filePath = nil;
    NSError *error = nil;
    for (NSString *subPath in subPathArr) {
        filePath = [path stringByAppendingPathComponent:subPath];
//        ZYLog(@"%@",filePath);
        if (![filePath containsString:@"/Caches/Snapshots"]) {
            //刪除子文件夾
            [[NSFileManager defaultManager] removeItemAtPath:filePath error:&error];
        }
        if (error) {
            ZYLog(@"%@",error);
            return NO;
        }
    }
    return YES;
}

#pragma mark - 模擬器下計(jì)算和清理WebKit文件夾的WKWebKit總緩存
+ (NSString *)getSimulatorWKWebKitCacheSize {
    NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
    NSString *identifier = [[NSBundle mainBundle] bundleIdentifier];
//    ZYLog(@"%@",identifier);
    NSString *path = [NSString stringWithFormat:@"%@/%@",cachesPath,identifier];
    path = [path stringByAppendingPathComponent:@"/WebKit"];
//    ZYLog(@"%@",path);
    // 獲取“path”文件夾下的所有文件
    NSArray *subPathArr = [[NSFileManager defaultManager] subpathsAtPath:path];
    NSString *filePath  = nil;
    NSInteger totleSize = 0;
    for (NSString *subPath in subPathArr){

        // 1. 拼接每一個(gè)文件的全路徑
        filePath =[path stringByAppendingPathComponent:subPath];
//        ZYLog(@"%@",filePath);
        // 2. 是否是文件夾,默認(rèn)不是
        BOOL isDirectory = NO;
        // 3. 判斷文件是否存在
        BOOL isExist = [[NSFileManager defaultManager] fileExistsAtPath:filePath isDirectory:&isDirectory];
        // 4. 以上判斷目的是忽略不需要計(jì)算的文件
        if (!isExist || isDirectory || [filePath containsString:@".DS"]){
            // 過濾: 1. 文件夾不存在  2. 過濾文件夾  3. 隱藏文件
            continue;
        }
        // 5. 指定路徑,獲取這個(gè)路徑的屬性
        NSDictionary *dict = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
        /**
         attributesOfItemAtPath: 文件夾路徑
         該方法只能獲取文件的屬性, 無法獲取文件夾屬性, 所以也是需要遍歷文件夾的每一個(gè)文件的原因
         */
        // 6. 獲取每一個(gè)文件的大小
        NSInteger size = [dict[@"NSFileSize"] integerValue];
        // 7. 計(jì)算總大小
        totleSize += size;
    }

    //8. 將文件夾大小轉(zhuǎn)換為 M/KB/B
    NSString *totleStr = nil;
    if (totleSize > 1000 * 1000){
        totleStr = [NSString stringWithFormat:@"%.2fM",totleSize / 1000.00f /1000.00f];
    }else if (totleSize > 1000){
        totleStr = [NSString stringWithFormat:@"%.2fKB",totleSize / 1000.00f ];
    }else{
        totleStr = [NSString stringWithFormat:@"%.2fB",totleSize / 1.00f];
    }
    return totleStr;
}

+ (BOOL)clearSimulatorWKWebKitCache {

    NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
    NSString *identifier = [[NSBundle mainBundle] bundleIdentifier];
    //    ZYLog(@"%@",identifier);
    NSString *path = [NSString stringWithFormat:@"%@/%@",cachesPath,identifier];
    path = [path stringByAppendingPathComponent:@"/WebKit"];
    //    ZYLog(@"%@",path);
    //拿到path路徑的下一級(jí)目錄的子文件夾
    NSArray *subPathArr = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
    NSString *filePath = nil;
    NSError *error = nil;
    for (NSString *subPath in subPathArr) {
        filePath = [path stringByAppendingPathComponent:subPath];
//        ZYLog(@"%@",filePath);
        if (![filePath containsString:@"/Caches/Snapshots"]) {
            //刪除子文件夾
            [[NSFileManager defaultManager] removeItemAtPath:filePath error:&error];
        }
        if (error) {
            ZYLog(@"%@",error);
            return NO;
        }
    }
    return YES;
}

@end

使用DEMO:


WOCOSetMyInfosController.m

//
//  WOCOSetMyInfosController.m
//  demo
//
//  Created by zhouyu on 2016/12/27.
//  Copyright ? 2016年 demo. All rights reserved.
//

#import "WOCOSetMyInfosController.h"
#import "ClearCachesTool.h"
#import "SVProgressHUD.h"

@interface WOCOSetMyInfosController ()
/**
 *  caches文件夾下緩存大小
 */
@property (nonatomic, copy) NSString *cachesSize;
@end

@implementation WOCOSetMyInfosController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.navigationItem.title = @"設(shè)置";
    self.tableView.backgroundColor = [UIColor whiteColor];
    self.tableView.scrollEnabled = NO;
    [self getCachesSize];
}

#pragma mark - 獲取Caches文件夾緩存大小
- (void)getCachesSize {
    // 子線程計(jì)算文件緩存
    dispatch_async(dispatch_get_global_queue(0, 0), ^{

        NSString *cachesSize = [ClearCachesTool getCacheSize];
        self.cachesSize = cachesSize;
        // 主線程更新顯示
        dispatch_async(dispatch_get_main_queue(), ^{
            NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
            UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
            cell.detailTextLabel.text = cachesSize;
            [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
            [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
        });

    });
}

#pragma mark - 刪除Caches文件夾緩存
- (void)clearCaches {
    // 子線程做刪除耗時(shí)操作
    if (self.cachesSize == nil) {
        return;
    }
    NSString *message = [NSString stringWithFormat:@"緩存大小為%@,確定要清理嗎?",self.cachesSize];

    UIAlertController *alertC = [UIAlertController alertControllerWithTitle:@"提示" message:message preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
    UIAlertAction *certain = [UIAlertAction actionWithTitle:@"確定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        [SVProgressHUD showWithStatus:@"正在拼命清理中..."];

        dispatch_async(dispatch_get_global_queue(0, 0), ^{
            [ClearCachesTool clearCache];
            // 主線程刷新顯示
            dispatch_async(dispatch_get_main_queue(), ^{
                [SVProgressHUD dismiss];
                NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
                UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
                self.cachesSize = nil;
                cell.detailTextLabel.text = @"清理完畢";
                [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
                [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
            });
        });
    }];
    [alertC addAction:cancel];
    [alertC addAction:certain];
    [self presentViewController:alertC animated:YES completion:nil];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    if (indexPath.row == 0) {
        [self clearCaches];
    }
}

#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *ID = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:ID];
    }

    if (indexPath.section == 0 && indexPath.row == 0) {
        cell.textLabel.text = @"清理緩存";
        cell.detailTextLabel.text = @"正在計(jì)算中...";
    }else {
        cell.textLabel.text = [NSString stringWithFormat:@"%ld",(long)indexPath.section];
        cell.detailTextLabel.text = @"^_^";
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}
@end


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 228,505評(píng)論 6 533
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 98,556評(píng)論 3 418
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 176,463評(píng)論 0 376
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經(jīng)常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,009評(píng)論 1 312
  • 正文 為了忘掉前任,我火速辦了婚禮,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 71,778評(píng)論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 55,218評(píng)論 1 324
  • 那天,我揣著相機(jī)與錄音,去河邊找鬼。 笑死,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,281評(píng)論 3 441
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 42,436評(píng)論 0 288
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 48,969評(píng)論 1 335
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 40,795評(píng)論 3 354
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 42,993評(píng)論 1 369
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,537評(píng)論 5 359
  • 正文 年R本政府宣布,位于F島的核電站,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 44,229評(píng)論 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,659評(píng)論 0 26
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 35,917評(píng)論 1 286
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 51,687評(píng)論 3 392
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 47,990評(píng)論 2 374

推薦閱讀更多精彩內(nèi)容

  • *面試心聲:其實(shí)這些題本人都沒怎么背,但是在上海 兩周半 面了大約10家 收到差不多3個(gè)offer,總結(jié)起來就是把...
    Dove_iOS閱讀 27,195評(píng)論 30 471
  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 134,785評(píng)論 18 139
  • 需求 緩存計(jì)算、緩存清理。 技術(shù)點(diǎn) 沙盒是什么 沙盒簡單來說就是一個(gè)應(yīng)用程序獨(dú)有的存儲(chǔ)和讀取內(nèi)容的地方,這個(gè)地方本...
    YY程序猿閱讀 7,537評(píng)論 0 12
  • 清理緩存概觀 清理緩存就是清理沙盒里非代碼文件 沙盒:iOS系統(tǒng)為每一個(gè)應(yīng)用程序創(chuàng)建一個(gè)文件目錄,是一個(gè)的獨(dú)立,封...
    溫學(xué)振閱讀 6,487評(píng)論 0 6
  • 傻狗
    razor51閱讀 313評(píng)論 0 1