Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
424 views
in Technique[技术] by (71.8m points)

ios - Thread 1 : EXC_BAD_ACCESS (Code = 1, address = 0x30000008)

I still stuck on this problem even followed all the answer from this forum. can anyone tell me what to do in simple way? I'm new learner in xcode. I have enable the zombie object.

this is my coding that got crash

if ([[[AryStoreknowItem objectAtIndex:indexPath.row] objectForKey:@"action"] isEqualToString:@"a1"]) {

    NSString *t1 =[[AryStoreknowItem objectAtIndex:indexPath.row] objectForKey:@"title"];

    NSString *a1 = [[AryStoreknowItem objectAtIndex:indexPath.row] objectForKey:@"action"];

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

    // saving an NSString
      [defaults setObject:a1 forKey:@"a1"];
      [defaults setObject:t1 forKey:@"t1"];

    JournalPage *journal=[[JournalPage alloc]initWithNibName:@"JournalPage" bundle:nil];

    [self presentModalViewController:journal animated:YES];

In my Application, I have multiple ViewController. when i click on back button of UINavigationBar then this type of issue generated , i can't explain my problem because all the functionality work proper.

Example :-

1 - fitstVController (work properly)

=> it have UITableView , when i click on specific row then it will be go on another UIViewController (SecoundViewController)

2 - SecoundViewController (work properly)

=> it have UITableView and UIActionSheet. when i select button of UiActionSheet then another UIViewController (ThirdViewController) is open

3 - ThirdViewController (cannot open)

=> error came when i click on row three. same goes if i click on other cell, the third cell that i click will got crash before in goes to other pages

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I don’t think we've got enough here to diagnose any particular problem (and it’s hard to follow your description). Nonetheless, I would recommend:

  1. I would suggest running your code through the static analyzer (shift+command+B or “Analyze” on the Xcode “Product” menu) and making sure that doesn't provide any warnings. That will (amongst other things) identify many routine memory issues that can easily plague non-ARC code. There's no point in going further until you get a clean bill of health here.

  2. I would suggest turning on the Exception Breakpoint and see if that identifies a particular line of code that is the source of the issue. Sometimes that can identify the line of code without having to reverse engineer where the error occurred by looking at the stack trace.

  3. Given that you're doing non-ARC code, you might also want to temporarily turn on zombies. You can see this setting the the Scheme Configuration settings.

  4. Beyond that, I’d refer you to Ray Wenderlich article My App Crashed, Now What?.

If you continue to have errors, share the stack trace with us.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...