程序收到信号:“EXC_BAD_ACCESS”。 while -[parsedxmlstring isEqualToString:textviewstring]?
不久,我正在解析 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 技术交流群。

一样将 md5 密码转换为字符串。
md5 转换后的密码可能不是 UTF8 字符串,因此请尝试像比较之前
The converted password from md5 might not be a UTF8string,so try converting md5 password in a string like
before comparing.