程序收到信号:“EXC_BAD_ACCESS”。 while -[parsedxmlstring isEqualToString:textviewstring]?

发布于 12-28 13:09 字数 1064 浏览 3 评论 0原文

不久,我正在解析 xml 文件并获取用户 MD5 密码。现在,当我在文本字段中比较解析的密码和用户给定的密码时,我发现程序收到信号:“EXC_BAD_ACCESS”

,当我不比较这些密码时,然后执行代码。这是我的代码。

if([checkingParsedPassword isEqualToString:passwordMD5String]){
tabbarController = [[TabbarController alloc] initWithNibName:@"TabbarController" bundle:nil];
UINavigationController *myTabbarController = [[[UINavigationController alloc] initWithRootViewController:tabbarController] autorelease];
myTabbarController.navigationBar.barStyle = UIBarStyleBlackOpaque;
[self.navigationController presentModalViewController:myTabbarController animated:YES];
[tabbarController release];    
}

如果我必须向您提供更多信息,请不要犹豫,因为我遇到了严重的问题。

编辑

当我使用NSLog时...我可以看到这两个字符串。

 NSLog(@"The parsed pass: %@ and the user pass: %@ ",checkingParsedPassword, passwordMD5String);

但是当我尝试比较时,我在 if 条件下得到了这些 exc_bad_access

if([checkingParsedPassword isEqualToString:passwordMD5String]){
    NSLog(@"checked");
}

Shortly, I am parsing a xml file and getting user MD5 password. Now when i am comparing parsed password and user given password in a text field then i am finding Program received signal: “EXC_BAD_ACCESS”

when i do not compare between these password then code execute.Here is my code.

if([checkingParsedPassword isEqualToString:passwordMD5String]){
tabbarController = [[TabbarController alloc] initWithNibName:@"TabbarController" bundle:nil];
UINavigationController *myTabbarController = [[[UINavigationController alloc] initWithRootViewController:tabbarController] autorelease];
myTabbarController.navigationBar.barStyle = UIBarStyleBlackOpaque;
[self.navigationController presentModalViewController:myTabbarController animated:YES];
[tabbarController release];    
}

If i have to give u any more information then please don't hesitate because i am in serious problem.

EDIT

when i am using NSLog...i can see both string.

 NSLog(@"The parsed pass: %@ and the user pass: %@ ",checkingParsedPassword, passwordMD5String);

but when i try to compare then i got these exc_bad_access on if condition

if([checkingParsedPassword isEqualToString:passwordMD5String]){
    NSLog(@"checked");
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清风挽心2025-01-04 13:09:46

一样将 md5 密码转换为字符串。

passwordMD5String=[NSString stringWithFormat:@"%@",passwordMD5String];

md5 转换后的密码可能不是 UTF8 字符串,因此请尝试像比较之前

The converted password from md5 might not be a UTF8string,so try converting md5 password in a string like

passwordMD5String=[NSString stringWithFormat:@"%@",passwordMD5String];

before comparing.

极致的悲2025-01-04 13:09:46

您正在 tabbarController 变量上调用 -release-autorelease (由于某种原因,它在代码中间更改了名称 - 您是否尝试在发帖?)。

You are calling both -release and -autorelease on the tabbarController variable (which changes name in the middle of the code for some reason--were you trying to clean it up when posting?).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文