XCode - EXC_BAD_ACCESS。 - [不是类型保留] [英] XCode - EXC_BAD_ACCESS. -[Not A Type retain]

查看:238
本文介绍了XCode - EXC_BAD_ACCESS。 - [不是类型保留]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将此



更新:我也试过禁用ARC每个文件与该库相关,通过使用链接器标志-fno-objC-arc但结果仍然相同。除了我尝试了 imageView.image = [UIImage imageWithCGImage:image.CGImage]; 或复制 imageView.image = [image copy];

很感谢
Kin

解决方案

BarCode Engine可能无法启用ARC。



禁用某些非ARC设计的文件,我们可以向编译器显示,让它通过此命令禁用ARC

  -fno-objc-arc 

put这个命令在项目构建阶段,所有编译的源代码存在(即项目名称中的所有类将显示)



ZBarSDK 是非常简单和易于使用和更强大的API为这个条形码,qr代码解码。


I'm trying to include this barcode source code by Stefanhafeneger to my project. I started it with a simple camera example and the barcode engine, everything works fine for the 1st barcode decode. When I try with the 2nd times, i receive EXC_BAD_ACCESS. It only work 1 time after that the application will crash.

Here is a screen recording of how the appilcation crash.

i'm testing with this DataMatrix tag from google in my appilcation.

i was surfing for solution for few days, I had tried NSZombieEnabled, and debug with Instrument but i still have no luck with it. The image below is the error from xcode.

*** -[Not A Type retain]: message sent to deallocated instance 0x7b21ed0

For your information it is an ARC enabled project. Someone please help, I'm still a few months old beginner.

Here is my xCode file for this project Barcode-Datamatrix Project

Update : I also tried disabling ARC for every file related to that library by Using the linker flag -fno-objC-arc but the result still the same. Besides i tried imageView.image = [UIImage imageWithCGImage:image.CGImage]; or a copy imageView.image = [image copy]; the application still crash at the same place.

Many Thanks Kin

解决方案

It may that BarCode Engine would not ARC enabled.

to disable some files which are not design for ARC support we can show to compiler that let it be ARC disable through this command

-fno-objc-arc

put this command on project build phases where all compiled source present ( i.e. all class in your project name will show)

ZBarSDK is quite simple and easy to use and more powerful API for this barcode, qr code decoding.

这篇关于XCode - EXC_BAD_ACCESS。 - [不是类型保留]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆