hw20101103 2015-05-22 09:35
浏览 1209

请问一下,为什么我把系统相册中的gif保存到沙盒之后就变成了静态图片?

 ALAssetRepresentation *representation = [asset defaultRepresentation];
 NSString *document = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
            NSString *filePath = [document stringByAppendingPathComponent:representation.filename];
            Byte *buffer = (Byte*)malloc(representation.size);
            NSUInteger buffered = [representation getBytes:buffer fromOffset:0.0 length:representation.size error:nil];
            NSData *data = [NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];
            [data writeToFile:filePath atomically:YES];
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何用stata画出文献中常见的安慰剂检验图
    • ¥15 c语言链表结构体数据插入
    • ¥40 使用MATLAB解答线性代数问题
    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败
    • ¥15 MapReduce实现倒排索引失败
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码
    • ¥50 随机森林与房贷信用风险模型