本文介绍了Xcode中的“ EXC_BAD_ACCESS”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在运行iPhone模拟时,我在Xcode中显示 EXC_BAD_ACCESS的错误
while run iphone simulation, I show the error for "EXC_BAD_ACCESS" in Xcode
代码如下:
Test.h
@interface Test : UIViewController
{
int iWeight;
}
end
Test.m
@implementation Test
- (void)viewDidLoad
{
iWeight = 15;
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
**NSLog(@"integer Number is :%@", iWeight); // error occur**
}
如果我单击UIAlertView,Xcode在该代码处发生 EXC_BAD_ACCESS错误
If i click the Button of UIAlertView, Xcode occur "EXC_BAD_ACCESS" error at that code
我不知道为什么该代码会发生错误。
I don't know why that code occur error. help me.
推荐答案
尝试 NSLog(@ integer Number is:%d,iWeight);
这篇关于Xcode中的“ EXC_BAD_ACCESS”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!