发布于 3年前

malloc: *** mach_vm_map(size=425511009624064) failed (error code=3) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug

当应用闪退控制台输出下面语句提示时,其实找到bug很简单

malloc: *** mach_vm_map(size=425511009624064) failed (error code=3)

*** error: can't allocate region

*** set a breakpoint in malloc_error_break to debug

解决办法:1、查找使用数组的地方,判断数组的count属性是否大于0就可以了

2、- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

return xxx;

}

这个方法中,即使你return的不是NSInteger的值,编译也不会报错,会在运行时闪退输出上面的提示,看到这个你只需要检查一下上面方法中是不是输出的NSInteger值,如果不是更改一下就可以了。

相关文章

©2020 edoou.com   京ICP备16001874号-3