ios遇到的bug记录

第三方库集成

百度

缺乏bundle display name的提示json


不在项目中修改文件数组

致使missing file服务器


使用命令行删除全部的.svn文件网络

sudo find /Users/apple/Documents/已完成项目/PJZJ/pjw178/  -name ".svn"  -exec rm  -r {} \;app


数组越界

能够参考我写的另外一篇博客中第一条进行定位处理svn

http://my.oschina.net/u/2360054/blog/606844#OSC_h2_1 工具


以下代码会产生一个数组越界的错误测试

NSArray *array=@[@"1",@"2"];
NSString *string=array[2];


Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 2 beyond bounds [0 .. 1]'



加入集合元素为空

NSMutableArray *array=[NSMutableArray array];
NSString *string;
[array addObject:string];

//以上代码会报错,由于string为nil

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
 NSString *string;
 NSDictionary *dict=@{@"key1":string};


*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'


网络请求

不支持text解析spa

json解析错误.net

非法开始数字 02, 很是蛋疼




404错误

检查网址吧,尝试http测试工具。多是网址错误或者服务器挂了


视频截图致使的内存不断增长

-(UIImage *)imageAtTime:(float)time asset:(AVURLAsset *)avAsset{
    CMTimeScale timeScale=avAsset.duration.timescale;
    AVAssetImageGenerator *gen = [[AVAssetImageGenerator alloc] initWithAsset:avAsset];
    
    gen.appliesPreferredTrackTransform = YES;
    CMTime imageTime ;
    float vedioTime=CMTimeGetSeconds(avAsset.duration);
    
    if (time>CMTimeGetSeconds(avAsset.duration)) {
        imageTime=CMTimeMakeWithSeconds(avAsset.duration.value,timeScale);
    }else{
        imageTime = CMTimeMakeWithSeconds(time, timeScale);
    }
    NSError *error = nil;
    CMTime actualTime;
    CGImageRef image = [gen copyCGImageAtTime:imageTime actualTime:NULL error:&error];
    UIImage *thumb = [[UIImage alloc] initWithCGImage:image];
    if (error) {
        NSLog(@"error%@",error);
    }
  
    
    return thumb;
}



没有明显的报错信息,就是每次执行完这个语句,内存就会不断增长。

在处理图片完成后须要加入 CFRealease释放内存

 CFRelease(image);


tableview cell 标示符重复


数据类型转换错误

相关文章
相关标签/搜索