- 浏览: 257773 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (70)
- Android (4)
- Linux (16)
- Oracle (5)
- eclipse (2)
- 随写 (1)
- JavaScript (1)
- HTML (3)
- Hibernate (2)
- ExtJS (1)
- MySQL (1)
- S2SH (1)
- Lucene (0)
- 测试 (1)
- tomcat (2)
- SVN (2)
- java基础 (1)
- JBPM4 (1)
- mongodb (1)
- 应用技巧 (2)
- web前端 (1)
- maven (4)
- web服务器 (1)
- Scrum敏捷开发 (0)
- 移动研发 (15)
- C/Object-C (16)
- xcode/iphone (15)
- git (1)
- xcode/ipad (10)
- 产品 (0)
- 用户体验 (0)
- WinPhone8 (1)
最新评论
-
lee哆啦A梦:
...
iphone开发--真机测试 -
jiangbing9293:
解释的很详细,学习了!很适合初学者学习。
iphone开发--真机测试 -
fangzhangsc2006:
步骤很详细很用心!
iphone开发--真机测试 -
Matrixes:
不知道结果是怎么样的。
eclipse中aptana的安装及破解 -
lpluck08:
回1楼:将"张三"单独做encode,试试 ...
HttpURLConnection的URL包含中文字符
刚开始学obj-c,遇到这个问题,网上搜了下,说的都有点短(本人愚钝,理解能力弱~~)。搞定后发上来,记录、共享。。
我的xcode是4.2的
操作如下:
1、增加NSZombieEnabled和MallocStackLogging环境变量:菜单Product--》Edit Scheme...,在弹出的窗口上方选择自己的项目及模拟器,左侧选择"Run ***.app"(***是你的项目名称),右侧选择Arguments选项卡,在Environment Variables中增加Name: NSZombieEnabled--》Value:YES、Name: MallocStackLogging--》Value:YES,并点击2个环境变量左侧的复选框,保证在启用状态。
2、debug自己的项目,出现EXC_BAD_ACCESS错误的时候,在控制台会出现类似下面的log
写道
fbft(1431) malloc: recording malloc stacks to disk using standard recorder
fbft(1431) malloc: process 1249 no longer exists, stack logs deleted from /tmp/stack-logs.1249.fbft.bBsBO7.index
fbft(1431) malloc: stack logs being written into /tmp/stack-logs.1431.fbft.Fz32vw.index
2012-01-18 11:38:55.118 fbft[1431:ef03] *** -[_UIResizableImage release]: message sent to deallocated instance 0x7245470
fbft(1431) malloc: process 1249 no longer exists, stack logs deleted from /tmp/stack-logs.1249.fbft.bBsBO7.index
fbft(1431) malloc: stack logs being written into /tmp/stack-logs.1431.fbft.Fz32vw.index
2012-01-18 11:38:55.118 fbft[1431:ef03] *** -[_UIResizableImage release]: message sent to deallocated instance 0x7245470
从最后一行可以看出是调用了已经被dealloc的对象。(UIResizableImage应该是已经release的对象类型)
3、在控制台的(gdb)后面输入shell malloc_history 1431 0x7245470(其中1431和0x7245470是上面log中的pid和address),并回车。得到如下信息
写道
......
ALLOC 0x7245470-0x72454af [size=64]: thread_b024f000 |thread_start | _pthread_start | _ZN2KBL14BackgroundLoadEPv | KB::DynamicDictionaryImpl::background_load_address_book(KB::StaticDictionary const&) | KB::fill_with_matchable_strings_from_address_book(KB::Hashmap<KB::String, bool>&) | ABAddressBookCreate | ABCCreateAddressBookWithDatabaseDirectory | ABCCreateAddressBookWithDatabaseDirectoryAndForceInProcessMigrationInProcessLinkingAndResetSortKeys | ABCDBContextCreateWithPathAndAddressBook | CPSqliteDatabaseRegisterFunction | CPSqliteDatabaseConnectionForWriting | _connectAndCheckVersion | _createConnectionForWriting | CPSqliteConnectionPerformSQL | CPSqliteConnectionStatementForSQLAndIgnoreErrors | CPSqlitePreparedStatement | sqlite3_prepare_v2 | sqlite3LockAndPrepare | sqlite3Prepare | sqlite3RunParser | sqlite3Parser | yy_reduce | sqlite3Pragma | sqlite3Init | sqlite3InitOne | sqlite3_exec | sqlite3InitCallback | sqlite3LockAndPrepare | sqlite3Prepare | sqlite3RunParser | sqlite3Parser | yy_reduce | sqlite3ExprAlloc | sqlite3DbMallocRaw | sqlite3MemMalloc | malloc_zone_malloc
----
FREE 0x7245470-0x72454af [size=64]: thread_b024f000 |thread_start | _pthread_start | _ZN2KBL14BackgroundLoadEPv | KB::DynamicDictionaryImpl::background_load_address_book(KB::StaticDictionary const&) | KB::fill_with_matchable_strings_from_address_book(KB::Hashmap<KB::String, bool>&) | ABAddressBookCreate | ABCCreateAddressBookWithDatabaseDirectory | ABCCreateAddressBookWithDatabaseDirectoryAndForceInProcessMigrationInProcessLinkingAndResetSortKeys | ABCDBContextCreateWithPathAndAddressBook | CPSqliteDatabaseRegisterFunction | CPSqliteDatabaseConnectionForWriting | _connectAndCheckVersion | _createConnectionForWriting | CPSqliteConnectionPerformSQL | CPSqliteConnectionStatementForSQLAndIgnoreErrors | CPSqlitePreparedStatement | sqlite3_prepare_v2 | sqlite3LockAndPrepare | sqlite3Prepare | sqlite3RunParser | sqlite3Parser | yy_reduce | sqlite3Pragma | sqlite3Init | sqlite3InitOne | sqlite3_exec | sqlite3InitCallback | sqlite3LockAndPrepare | sqlite3Prepare | sqlite3RunParser | sqlite3Parser | yy_reduce | sqlite3ExprDelete | sqlite3ExprDelete | sqlite3ExprDelete | sqlite3ExprDelete | sqlite3ExprDelete | sqlite3ExprListDelete | sqlite3ExprDelete | sqlite3DbFree | sqlite3MemFree | malloc_zone_free
ALLOC 0x7245470-0x7245493 [size=36]: thread_ad12a2c0 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunInMode | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoSource1 | __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ | PurpleEventCallback | _UIApplicationHandleEvent | -[UIApplication sendEvent:] | -[UIApplication handleEvent:withNewEvent:] | -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] | -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] | -[FbftAppDelegate application:didFinishLaunchingWithOptions:] | -[UIWindow makeKeyAndVisible] | -[UIWindow _orderFrontWithoutMakingKey] | -[UIWindow _setHidden:forced:] | -[UIWindow addRootViewControllerViewIfPossible] | -[UIViewController view] | -[TestViewController viewDidLoad] | -[UIImage(UIImageDeprecated) stretchableImageWithLeftCapWidth:topCapHeight:] | -[UIImage(UIImagePrivate) _stretchableImageWithCapInsets:] | -[UIImage resizableImageWithCapInsets:] | _objc_rootAlloc | +[NSObject allocWithZone:] | _objc_rootAllocWithZone | class_createInstance | calloc | malloc_zone_calloc
Binary Images:
0x1000 - 0x3ffb +fbft (??? - ???) <92BCD2F3-83ED-36DD-A56A-37022E0229E0> /Users/fangjiawang/Library/Application Support/iPhone Simulator/5.0/Applications/8ED06429-A51E-4D6C-9ACC-C9A6E269C80A/fbft.app/fbft
0x7000 - 0x612fff +UIKit (1600.0.0 - comp
.......
ALLOC 0x7245470-0x72454af [size=64]: thread_b024f000 |thread_start | _pthread_start | _ZN2KBL14BackgroundLoadEPv | KB::DynamicDictionaryImpl::background_load_address_book(KB::StaticDictionary const&) | KB::fill_with_matchable_strings_from_address_book(KB::Hashmap<KB::String, bool>&) | ABAddressBookCreate | ABCCreateAddressBookWithDatabaseDirectory | ABCCreateAddressBookWithDatabaseDirectoryAndForceInProcessMigrationInProcessLinkingAndResetSortKeys | ABCDBContextCreateWithPathAndAddressBook | CPSqliteDatabaseRegisterFunction | CPSqliteDatabaseConnectionForWriting | _connectAndCheckVersion | _createConnectionForWriting | CPSqliteConnectionPerformSQL | CPSqliteConnectionStatementForSQLAndIgnoreErrors | CPSqlitePreparedStatement | sqlite3_prepare_v2 | sqlite3LockAndPrepare | sqlite3Prepare | sqlite3RunParser | sqlite3Parser | yy_reduce | sqlite3Pragma | sqlite3Init | sqlite3InitOne | sqlite3_exec | sqlite3InitCallback | sqlite3LockAndPrepare | sqlite3Prepare | sqlite3RunParser | sqlite3Parser | yy_reduce | sqlite3ExprAlloc | sqlite3DbMallocRaw | sqlite3MemMalloc | malloc_zone_malloc
----
FREE 0x7245470-0x72454af [size=64]: thread_b024f000 |thread_start | _pthread_start | _ZN2KBL14BackgroundLoadEPv | KB::DynamicDictionaryImpl::background_load_address_book(KB::StaticDictionary const&) | KB::fill_with_matchable_strings_from_address_book(KB::Hashmap<KB::String, bool>&) | ABAddressBookCreate | ABCCreateAddressBookWithDatabaseDirectory | ABCCreateAddressBookWithDatabaseDirectoryAndForceInProcessMigrationInProcessLinkingAndResetSortKeys | ABCDBContextCreateWithPathAndAddressBook | CPSqliteDatabaseRegisterFunction | CPSqliteDatabaseConnectionForWriting | _connectAndCheckVersion | _createConnectionForWriting | CPSqliteConnectionPerformSQL | CPSqliteConnectionStatementForSQLAndIgnoreErrors | CPSqlitePreparedStatement | sqlite3_prepare_v2 | sqlite3LockAndPrepare | sqlite3Prepare | sqlite3RunParser | sqlite3Parser | yy_reduce | sqlite3Pragma | sqlite3Init | sqlite3InitOne | sqlite3_exec | sqlite3InitCallback | sqlite3LockAndPrepare | sqlite3Prepare | sqlite3RunParser | sqlite3Parser | yy_reduce | sqlite3ExprDelete | sqlite3ExprDelete | sqlite3ExprDelete | sqlite3ExprDelete | sqlite3ExprDelete | sqlite3ExprListDelete | sqlite3ExprDelete | sqlite3DbFree | sqlite3MemFree | malloc_zone_free
ALLOC 0x7245470-0x7245493 [size=36]: thread_ad12a2c0 |start | main | UIApplicationMain | -[UIApplication _run] | CFRunLoopRunInMode | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoSource1 | __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ | PurpleEventCallback | _UIApplicationHandleEvent | -[UIApplication sendEvent:] | -[UIApplication handleEvent:withNewEvent:] | -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] | -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] | -[FbftAppDelegate application:didFinishLaunchingWithOptions:] | -[UIWindow makeKeyAndVisible] | -[UIWindow _orderFrontWithoutMakingKey] | -[UIWindow _setHidden:forced:] | -[UIWindow addRootViewControllerViewIfPossible] | -[UIViewController view] | -[TestViewController viewDidLoad] | -[UIImage(UIImageDeprecated) stretchableImageWithLeftCapWidth:topCapHeight:] | -[UIImage(UIImagePrivate) _stretchableImageWithCapInsets:] | -[UIImage resizableImageWithCapInsets:] | _objc_rootAlloc | +[NSObject allocWithZone:] | _objc_rootAllocWithZone | class_createInstance | calloc | malloc_zone_calloc
Binary Images:
0x1000 - 0x3ffb +fbft (??? - ???) <92BCD2F3-83ED-36DD-A56A-37022E0229E0> /Users/fangjiawang/Library/Application Support/iPhone Simulator/5.0/Applications/8ED06429-A51E-4D6C-9ACC-C9A6E269C80A/fbft.app/fbft
0x7000 - 0x612fff +UIKit (1600.0.0 - comp
.......
从上面标红的log中可以大概知道是哪里的代码出了问题,TestViewController类中的stretchableImageWithLeftCapWidth:topCapHeight方法中引入了已经release对象。
PS-疑问:配置的两个环境变量,对发布出来的应用有影响吗?有答案的留下言~ 谢谢~~
发表评论
-
WinPhone8开发--插件App的制作方式(插件中包含图片等资源)
2013-02-21 10:54 1636刚接触WinPhone8开发,不知道这种方式是否是正确的方式 ... -
ios开发--旋转、移动、缩放手势实例代码
2013-01-31 14:23 14593代码如下: // 添加所有的手势 - (void) ad ... -
ios开发--KVO浅析
2013-01-15 16:24 15270目标:监听NSMutableArray对象中增加了什么 ... -
ios开发--常用宏定义(部分转)
2013-01-12 21:31 42991、release时,屏蔽log #if defined ( ... -
ios开发--通过UIView对象获取该对象所属的UIViewController(转)
2012-12-15 16:44 8178通过UIView对象获取该对象所属的UIViewCon ... -
ios开发--UINavigationController中弹出自定义alert或自定义view
2012-12-15 15:08 5845项目中经常遇到需要在UINavigationContr ... -
ios开发--应用中为某一类型对象设置统一的值(ios5.0以上)
2012-12-12 21:25 1252app中经常遇到这种问题:出现的所有的navigation b ... -
iphone开发--mac系统制作自动缩小图片服务
2012-11-17 10:27 5802iOS开发中,因为 ... -
iphone开发--大区域中平铺(非拉伸)图片
2012-11-10 22:14 1151创建一个UIView的子类,在- (void)drawRect ... -
iphone开发--读取获取Documents及tmp目录
2012-10-14 21:42 1799获取Documents目录路径 NSArray ... -
apk的压缩方式
2012-09-14 14:45 14761、去除无用资源文件及文件压缩等; 2、使用ProGu ... -
iphone开发--UITableView中的cell高度不一致解决方案
2012-05-26 22:09 2861事先声明:本例没有做任何性能上的考虑, 而且写的很生硬,只是演 ... -
ipad开发--模态窗口中不能隐藏键盘
2012-05-09 11:25 1369使用resignFirstResponder也不能隐藏键盘,需 ... -
iphone开发--上架app至App Store
2012-03-02 13:50 80421、首先在https://itunesconnect ... -
iphone开发--真机测试
2012-03-02 13:46 19234如何进行真机测试? 需要得到apple官方的d ... -
iphone开发实现细节
2012-02-23 09:32 5072UIImageC处理 1、等比缩放 - (UI ... -
iphone开发实现细节--获取当前app的名称和版本号
2012-02-17 10:54 120NSDictionary *infoDictio ... -
iphone开发实现细节--UILabel根据text自动调整大小
2012-02-15 16:45 52不废话,直接上代码 label.text = ... -
obj-c学习笔记
2012-01-29 10:21 1383内存管理: 1、一个对象的所有者可能不止一个。 ... -
Dev-C++中编译C语言报错
2012-01-05 09:24 5719环境:先装了MinGW,又装了Dev-C++,编译c的时候报错 ...
相关推荐
在ios开发过程中经常出现EXC_BAD_ACCESS错误而导致程序崩溃,这里将介绍如何利用XCode和Instrument来查找错误发生的地方,从而更好的定位
详细介绍了通过Instrument工具,可视化的定位EXC_BAD_ACCESS 错误的位置。是本人自己实践总结出来,绝对好用。
查找 EXC_BAD_ACCESS 问题根源的方法
iOS开发,最郁闷的莫过于程序毫无征兆地就崩溃了,用bt命令打出调用栈,给出的是一堆系统EXC_BAD_ACCESS的信息,根本没办法定位问题出现在哪里
NULL 博文链接:https://bengan.iteye.com/blog/1471440
db2exc_975_WIN 数据库安装包,官网下载,亲测可用。 IBM DB2 是一套关系型数据库管理系统,DB2 Express - C
db2exc_970_LNX_x86_64.tar.gz Linux 64位系统 的db2 安装包。(第一部分)
db2exc_970_LNX_x86_64.tar.gz Linux 64位系统 的db2 安装包。(第二部分) 另一部分:https://download.csdn.net/download/qq_37570669/11260296
使用 sys 模块中的 exc_info 方法; 使用 traceback 模块中的相关函数。 本节首先介绍如何使用 sys 模块中的 exc_info() 方法获得更多的异常信息。 有关 sys 模块更详细的介绍,可阅读《Python sys模块》。 模块 ...
excitatory neuron connection.
电磁波时域有限元分析代码,更够很好的仿真波形不失真
主要涉及ADO编程模型中的记录集。
CAD to Excel VBA程序 AutoCAD中的二次开发程序
excel做的传统工程量计算表(加入vba后能自动计算、汇总、标注说明) 1、序号根据填入的分部分项名称自动填出1~N的数值。 2、代码栏根据填入的数据自动给出同一分部分项名称序号,为汇总提供方便。...
VB.NET编写 自动提取Excel 中的数据程序
出现EXC_BAD_ACCESS。 需要修改Product->Scheme->Edit Scheme->Options->GPU Frame Capture 选择 Disabled。 功能介绍 模仿Filckr的照相功能实现了: 1.实时滤镜 2.相机基本功能:拍照,对焦,前后...
CK_EXC_UnityGraphicBeginner
CGImageIssueDemo 核心图形问题测试 做什么的 似乎对于iOS 11.2 +, CoreGraphics.framework发生了奇怪的... 这导致EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 。 重现步骤 使用CGDataProviderCreateDi