iOS开发中工具类(方法)

本文章主要我在实际开发过程中常用到的一些方法或函数,未来类似功能可以直接调用或者修改即可使用。本篇将长期更新。

目录

  • UIGraphicsBeginImageContext消除锯齿
  • iOS线程
  • UIbutton图片和文字默认偏移(上下)
  • 判断设置是否越狱
  • 判断是否是数字
  • 判断是否是字符(a-z)
  • 获取当前任务占用的内存
  • 获取中英文混合字符串的长度
  • 获取字节长度
  • 获取app的沙盒路径
  • 为Button绘制背景图片
  • 判断空字符串
  • 判断单个文件大小
  • 获取视频第一帧
  • 获取系统字体
  • 比对与当前时间的天数差
  • 色值转换(#2324512z转UIColor)
  • 通过颜色设置图片
  • 通过颜色设置图片(有高度)
  • 将图片转换为黑白
  • 缓存图片到本地 (注意:需要指定缓存路径,获取到本地沙盒路径等)。
  • 图片裁剪(传入Rect)
  • 按尺寸压缩图片
  • 设置阴影
  • 价格转换为每隔3位用逗号分割

ARC && MRC 使用

  • ARC环境中引入MRC文件 加入-fno-objc-arc
  • MRC环境引入ARC文件,加入:-fobjc-arc

  • UIGraphicsBeginImageContext消除锯齿
    最近在做连线的时候发现,斜线会有锯齿存在。查阅资料发现是像素点原因引起,以下只是简单解决的一种方式,有一定效果但不全面。仅做记录。
//方法1
view.layer.contentsScale = [[UIScreen mainScreen] scale];

//方法2
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetAllowsAntialiasing(context,true);//开启自动去锯齿
CGContextSetShouldAntialias(context, true);

  • iOS线程

一般来说,队列可分为两种类型:串行和并行。也可以分为系统队列和用户队列两种

串行:
dispatch_get_main_queue() 主线程队列,在主线程中执行
dispatch_queue_create(DISPATCH_QUEUE_SERIAL) 自定义串行队列
并行:
dispatch_get_global_queue() 由系统维护的并行队列
dispatch_queue_create(DISPATCH_QUEUE_CONCURRENT) 自定义并发队列

This function is the fundamental mechanism for submitting blocks to a dispatch queue. Calls to this function always return immediately after the block has been submitted and never wait for the block to be invoked. The target queue determines whether the block is invoked serially or concurrently with respect to other blocks submitted to that same queue. Independent serial queues are processed concurrently with respect to each other.

该函数为向dispatch队列中提交block对象的最基础的机制。调用这个接口后将block提交后会马上返回,并不会等待block被调用。参数queue决定block对象是被串行执行还是并行执行。不同的串行队列将被并行处理。

示例:

  //在主线程执行一个block
    dispatch_async(dispatch_get_main_queue(), ^{
        NSLog(@"invoke in main thread.");
    });
  //异步执行一个block
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        NSLog(@"invoke in another thread which is in system thread pool.");
    });
  • UIbutton图片和文字默认偏移(上下)
    注意:传入需要设置的Button和文字和图片之间的垂直距离即可。
+ (void)setButtonImageAndTitleVerticalCenterWithSpace:(CGFloat)space button:(UIButton *)button
{
    CGSize imageSize = button.imageView.frame.size;
    CGSize titleSize = [button.titleLabel.text sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12]}];
    CGFloat totalHeight = (imageSize.height + titleSize.height + space);
    button.imageEdgeInsets = UIEdgeInsetsMake(- (totalHeight - imageSize.height), 0.0, 0.0, - titleSize.width);
    button.titleEdgeInsets = UIEdgeInsetsMake(0.0, - imageSize.width, - (totalHeight - titleSize.height),0.0);
}
  • 判断设置是否越狱
+ (BOOL)isJailbroken {
    BOOL jailbroken = NO;
    NSString *cydiaPath = @"/Applications/Cydia.app";
    NSString *aptPath = @"/private/var/lib/apt/";
    if ([[NSFileManager defaultManager] fileExistsAtPath:cydiaPath]) {
        jailbroken = YES;
    }
    if ([[NSFileManager defaultManager] fileExistsAtPath:aptPath]) {
        jailbroken = YES;
    }
    return jailbroken;
}
  • 判断是否是数字
+ (BOOL) validateNumber: (NSString *) number{
    NSString *reg = @"^[0-9]*$";
    NSPredicate *numberTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", reg];
    return [numberTest evaluateWithObject:number];
}
  • 判断是否是字符(a-z)
+ (BOOL)validata:(NSString *)number{
    NSString *regex = @"[A-Za-z]+";
    NSPredicate *numberTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
    return [numberTest evaluateWithObject:number];
}
  • 获取当前任务占用的内存
+ (double)usedMemory
{
    task_basic_info_data_t taskInfo;
    mach_msg_type_number_t infoCount = TASK_BASIC_INFO_COUNT;
    kern_return_t kernReturn = task_info(mach_task_self(),
                                         TASK_BASIC_INFO, (task_info_t)&taskInfo, &infoCount);
    if(kernReturn != KERN_SUCCESS) {
        return NSNotFound;
    }
    return taskInfo.resident_size / 1024.0 / 1024.0;
}
  • 获取中英文混合字符串的长度
+ (int)convertToInt:(NSString*)strtemp
{
    int strlength = 0;
    char* p = (char*)[strtemp cStringUsingEncoding:NSUnicodeStringEncoding];
    for (int i=0 ; i<[strtemp lengthOfBytesUsingEncoding:NSUnicodeStringEncoding] ;i++) {
        if (*p) {
            p++;
            strlength++;
        }
        else {
            p++;
        }

    }
    return strlength;
}
  • 获取字节长度
+(NSUInteger) unicodeLengthOfString: (NSString *) text {
    NSUInteger asciiLength = 0;

    for (NSUInteger i = 0; i < text.length; i++) {
        unichar uc = [text characterAtIndex: i];
        asciiLength += isascii(uc) ? 1 : 2;
    }

    NSUInteger unicodeLength = asciiLength / 2;

    if(asciiLength % 2) {
        unicodeLength++;
    }

    return unicodeLength;
}
  • 获取app的沙盒路径
+ (NSString *)documentPath
{
    // 获取应用程序沙盒的Documents目录
    NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
    return [paths objectAtIndex:0];
}
  • 为Button绘制背景图片
+ (void)backgroundTurnRedForButton:(UIButton *)button red:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha  type:(int) type{
    CGSize size = button.frame.size;
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
    view.layer.cornerRadius = 6;
    view.clipsToBounds = true;
    view.backgroundColor = [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
    UIGraphicsBeginImageContext(size);
    [view.layer renderInContext:UIGraphicsGetCurrentContext()];

    UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    switch (type) {
        case 0:
            [button setBackgroundImage:screenImage forState:UIControlStateNormal];
            break;
        case 1:
            [button setBackgroundImage:screenImage forState:UIControlStateHighlighted];
            break;
        default:
            break;
    }

}
  • 判断空字符串
+(BOOL) isEmptyOrNull:(NSString *) str {
    if (!str) {
        // null object
        return YES;
    } else {
        NSString *trimedString = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
        if ([trimedString length] == 0) {
            // empty string
            return YES;
        } else {
            // is neither empty nor null
            return NO;
        }
    }
}
  • 判断单个文件大小
+(long long)fileSizeAtPath:(NSString*)filePath{
    NSFileManager* manager = [NSFileManager defaultManager];
    if ([manager fileExistsAtPath:filePath]){
        return [[manager attributesOfItemAtPath:filePath error:nil] fileSize];
    }
    return 0;
}
  • 获取视频第一帧
+(UIImage *)getPreViewImg:(NSString *)url
{
    UIImage *img = nil;
    @autoreleasepool {
        NSURL *urlvideo = nil;

        if([url hasPrefix:@"assets-library:"] ) {
            urlvideo = [NSURL URLWithString:url];
        }else{
            urlvideo = [[NSURL alloc]initFileURLWithPath:url];
        }

        AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:urlvideo options:nil];
        AVAssetImageGenerator *gen = [[AVAssetImageGenerator alloc] initWithAsset:asset];
        gen.appliesPreferredTrackTransform = YES;
        CMTime time = CMTimeMakeWithSeconds(0.0, 600);
        NSError *error = nil;
        CMTime actualTime;
        CGImageRef image = [gen copyCGImageAtTime:time actualTime:&actualTime error:&error];
        img = [[UIImage alloc] initWithCGImage:image];
        CGImageRelease(image);
    }
    return img;
}
  • 获取本机IP
+ (NSString *)getIPAddress
{

    NSString *address = @"error";
    struct ifaddrs *interfaces = NULL;
    struct ifaddrs *temp_addr = NULL;
    int success = 0;

    // retrieve the current interfaces - returns 0 on success
    success = getifaddrs(&interfaces);
    if (success == 0) {
        // Loop through linked list of interfaces
        temp_addr = interfaces;
        while (temp_addr != NULL) {
            if( temp_addr->ifa_addr->sa_family == AF_INET) {
                // Check if interface is en0 which is the wifi connection on the iPhone
                if ([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"]) {
                    // Get NSString from C String
                    address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)];
                }
            }

            temp_addr = temp_addr->ifa_next;
        }
    }

    // Free memory
    freeifaddrs(interfaces);

    return address;
}
  • 获取系统字体
+ (UIFont*)getCurrentFont
{
    //判断系统字体的size,返回使用的字体。
    UIFont *font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
    return font;
}
  • 比对与当前时间的天数差
*
 *对比两个时间
 *date:需要跟当前时间对比的时间
 */
+ (int)getTimedif:(NSDate*)date
{
    int num = 0;
    if (!date) {
        return num;
    }

    NSCalendar *calendar = [NSCalendar currentCalendar];
    NSDateComponents *components = [calendar components:NSDayCalendarUnit|NSHourCalendarUnit|NSMinuteCalendarUnit fromDate:[NSDate date]];
    NSDateComponents *dtComponents = [calendar components:NSDayCalendarUnit|NSHourCalendarUnit|NSMinuteCalendarUnit fromDate:date];
    num = [components day] - [dtComponents day];
    return num;
}

颜色

  • 色值转换(#2324512z转UIColor)
+ (UIColor *)hexString:(NSString *)hex{
    hex = [hex stringByReplacingOccurrencesOfString:@"#" withString:@""];
    if (hex.length<6) {
        return nil;
    }

    unsigned int r,g,b;
    NSRange stringRange;

    stringRange.length = 2;
    stringRange.location = 0;
    [[NSScanner scannerWithString:[hex substringWithRange:stringRange]] scanHexInt:&r];

    stringRange.location = 2;
    [[NSScanner scannerWithString:[hex substringWithRange:stringRange]] scanHexInt:&g];

    stringRange.location = 4;
    [[NSScanner scannerWithString:[hex substringWithRange:stringRange]] scanHexInt:&b];

    float fr = (r * 1.0f) / 255.0f;
    float fg = (g * 1.0f) / 255.0f;
    float fb = (b * 1.0f) / 255.0f;

    return [UIColor colorWithRed:fr green:fg blue:fb alpha:1.0f];
}
  • 通过颜色设置图片
+ (UIImage *)createImageWithColor:(UIColor *)color
{
    CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    return theImage;
}
  • 通过颜色设置图片(有高度)
- (UIImage*) GetImageWithColor:(UIColor*)color andHeight:(CGFloat)height
{
    CGRect r= CGRectMake(0.0f, 0.0f, 1.0f, height);
    UIGraphicsBeginImageContext(r.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, r);
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return img;
}

图片处理

  • 裁剪图片为圆形
+(UIImage*) circleImage:(UIImage*) image withParam:(CGFloat) inset {
    UIGraphicsBeginImageContext(image.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetLineWidth(context, 20);
    CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
    CGRect rect = CGRectMake(inset, inset, image.size.width - inset * 2.0f, image.size.height - inset * 2.0f);
    CGContextAddEllipseInRect(context, rect);
    CGContextClip(context);

    [image drawInRect:rect];
    CGContextAddEllipseInRect(context, rect);
    CGContextStrokePath(context);
    UIImage *newimg = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return newimg;
}
  • 为图片添加圆角显示
//给图片添加圆角显示
+ (UIImage *) roundCorners: (UIImage*) img
{
    int w = img.size.width;
    int h = img.size.height;

    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, 4 * w, colorSpace, kCGImageAlphaPremultipliedFirst);

    CGContextBeginPath(context);
    CGRect rect = CGRectMake(0, 0, img.size.width, img.size.height);
    addRoundedRectToPath(context, rect, 10, 10);
    CGContextClosePath(context);
    CGContextClip(context);

    CGContextDrawImage(context, CGRectMake(0, 0, w, h), img.CGImage);

    CGImageRef imageMasked = CGBitmapContextCreateImage(context);
    CGContextRelease(context);
    CGColorSpaceRelease(colorSpace);
    UIImage *images = [UIImage imageWithCGImage:imageMasked];
    CGImageRelease(imageMasked);
    return images;
}
  • 将图片转换为黑白
+ (UIImage*)blackAndWhitePhoto:(UIImage*)anImage
{

    CGImageRef imageRef = anImage.CGImage;

    size_t width  = CGImageGetWidth(imageRef);
    size_t height = CGImageGetHeight(imageRef);

    size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef);
    size_t bitsPerPixel = CGImageGetBitsPerPixel(imageRef);

    size_t bytesPerRow = CGImageGetBytesPerRow(imageRef);

    CGColorSpaceRef colorSpace = CGImageGetColorSpace(imageRef);

    CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);


    bool shouldInterpolate = CGImageGetShouldInterpolate(imageRef);

    CGColorRenderingIntent intent = CGImageGetRenderingIntent(imageRef);

    CGDataProviderRef dataProvider = CGImageGetDataProvider(imageRef);

    CFDataRef data = CGDataProviderCopyData(dataProvider);

    UInt8 *buffer = (UInt8*)CFDataGetBytePtr(data);

    NSUInteger  x, y;
    for (y = 0; y < height; y++) {
        for (x = 0; x < width; x++) {
            UInt8 *tmp;
            tmp = buffer + y * bytesPerRow + x * 4;

            UInt8 red,green,blue;
            red = *(tmp + 0);
            green = *(tmp + 1);
            blue = *(tmp + 2);

            UInt8 brightness;
            brightness = (77 * red + 28 * green + 151 * blue) / 256;
            *(tmp + 0) = brightness;
            *(tmp + 1) = brightness;
            *(tmp + 2) = brightness;
        }
    }


    CFDataRef effectedData = CFDataCreate(NULL, buffer, CFDataGetLength(data));

    CGDataProviderRef effectedDataProvider = CGDataProviderCreateWithCFData(effectedData);

    CGImageRef effectedCgImage = CGImageCreate(
                                               width, height,
                                               bitsPerComponent, bitsPerPixel, bytesPerRow,
                                               colorSpace, bitmapInfo, effectedDataProvider,
                                               NULL, shouldInterpolate, intent);

    UIImage *effectedImage = [[UIImage alloc] initWithCGImage:effectedCgImage];

    CGImageRelease(effectedCgImage);

    CFRelease(effectedDataProvider);

    CFRelease(effectedData);

    CFRelease(data);

    return effectedImage;
}
  • 缓存图片到本地
注意:需要指定缓存路径,获取到本地沙盒路径等。
+ (void)saveImageimageData:(NSData *)imgData
{
    NSString *path = @"chat/Image_send/";
    if (![[NSFileManager defaultManager]fileExistsAtPath:[[LX_Sandbox docPath] stringByAppendingPathComponent:path]])
        [[NSFileManager defaultManager]createDirectoryAtPath:[[LX_Sandbox docPath]stringByAppendingPathComponent:path] withIntermediateDirectories:YES attributes:nil error:nil];

    NSString *imgPath = [[[LX_Sandbox docPath]stringByAppendingPathComponent:path]stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png",[Function getSendMessageTime]]];
    if ([[NSFileManager defaultManager]fileExistsAtPath:imgPath]) {
        [[NSFileManager defaultManager]removeItemAtPath:imgPath error:nil];
    }

    if ([[NSFileManager defaultManager]createFileAtPath:imgPath contents:nil attributes:nil]) {
        [imgData writeToFile:imgPath  atomically:YES];
    }
}
  • 图片裁剪(传入Rect)
+(UIImage *)imageCropping:(UIImage*)image  rect:(CGRect)rect{

    CGImageRef cr = CGImageCreateWithImageInRect([image CGImage], rect);
    UIImage *cropped = [UIImage imageWithCGImage:cr];
    CGImageRelease(cr);
    return cropped;
}
  • 按尺寸压缩图片
+ (UIImage*)scaleFromImage:(UIImage*)image scaledToSize:(CGSize)newSize
{
    UIImage* newImage = nil;
    @autoreleasepool {
        CGSize  imageSize = image.size;
        CGFloat width = imageSize.width;
        CGFloat height = imageSize.height;

        if(width <= newSize.width && height <= newSize.height){
            return image;
        }

        if(width == 0 || height == 0){
            return image;
        }

        CGFloat widthFactor = newSize.width / width;
        CGFloat heightFactor = newSize.height / height;
        CGFloat scaleFactor = (widthFactor<heightFactor?widthFactor:heightFactor);

        CGFloat scaledWidth = width * scaleFactor;
        CGFloat scaledHeight = height * scaleFactor;
        CGSize  targetSize = CGSizeMake(scaledWidth,scaledHeight);

        UIGraphicsBeginImageContext(targetSize);
        [image drawInRect:CGRectMake(0,0,targetSize.width,targetSize.height)];
        newImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
    }
    return newImage;
}

  • 阴影
/// 设置阴影
/// @param layer 阴影作用layer
/// @param offset 偏移量
/// @param cornerRadius layer半径
/// @param shadowRadius 阴影半径
/// @param shadowOpacity 阴影透明度
/// @param shadowColor 阴影颜色
/// @param backgroundColor 背景色

- (void)setShadowWithLayer:(CALayer *)layer offset:(CGSize)offset cornerRadius:(CGFloat)cornerRadius shadowRadius:(CGFloat)shadowRadius shadowOpacity:(CGFloat)shadowOpacity shadowColor:(UIColor *)shadowColor backgroundColor:(UIColor *)backgroundColor{
    layer.backgroundColor = backgroundColor.CGColor;
    layer.shadowOpacity = shadowOpacity;//阴影透明度
    layer.shadowColor = shadowColor.CGColor;//阴影颜色
    layer.shadowOffset = offset;//阴影偏移量
    layer.shadowRadius = shadowRadius;//模糊计算半径
    layer.cornerRadius = cornerRadius;
    layer.masksToBounds = NO;
}
  • 价格转换为每隔3位用逗号分割
/**
 价格转换为每隔3位用逗号分割
 show 是否显示小数点后面
 */
- (NSString *)changePriceWithNumber:(float)value showPoint:(BOOL)show {
    NSString *valueStr = @"";
    NSString *format = @"";
    if (show) {
        valueStr = [NSString stringWithFormat:@"%.2f", value];
        format = @",###.##";
    } else {
        valueStr = [NSString stringWithFormat:@"%.f", value];
        format = @",###";
    }
    NSDecimalNumber *decNumber = [NSDecimalNumber decimalNumberWithString:valueStr];
    NSNumberFormatter *numberFormatter =   [[NSNumberFormatter alloc] init];
    [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
    [numberFormatter setPositiveFormat:format];
    return [numberFormatter stringFromNumber:decNumber];
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,884评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,347评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,435评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,509评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,611评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,837评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,987评论 3 408
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,730评论 0 267
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,194评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,525评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,664评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,334评论 4 330
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,944评论 3 313
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,764评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,997评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,389评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,554评论 2 349

推荐阅读更多精彩内容

  • iOS多线程编程 基本知识 1. 进程(process) 进程是指在系统中正在运行的一个应用程序,就是一段程序的执...
    陵无山阅读 6,025评论 1 14
  • Swift1> Swift和OC的区别1.1> Swift没有地址/指针的概念1.2> 泛型1.3> 类型严谨 对...
    cosWriter阅读 11,092评论 1 32
  • iOS中GCD的使用小结 作者dullgrass 2015.11.20 09:41*字数 4996阅读 20199...
    DanDanC阅读 820评论 0 0
  • 3.1 Grand Central Dispatch(GCD)概要 3.1.1 什么是CGD Grand Cent...
    SkyMing一C阅读 1,614评论 0 22
  • 躲在白昼最黑暗的时刻,我是静谧无声的歌。 此刻能湮灭罪恶,我是无暇的璞玉,是璀璨的星辰,是色彩斑斓的草丛中最美的一...
    圈圈城阅读 261评论 0 0