From your second post, the line you have commented out (button release) releases an object already marked to be released automatically.
From your second post, the line you have commented out (button release) releases an object already marked to be released automatically. Either remove the "autorelease" where you are doing an alloc for the button or remove the button release statement for the code to compile without errors and exceptions. If an object is marked for autorelease, calling a release on it will be the same as calling a release on a deallocated instance, hence the error.
The latter. I can step out ok. Any attempt to keep stepping just keeps the debugger on the same line.
I continue and splat! – 4thSpace Mar 13 '09 at 22:34.
At a glance I would say there is nothing wrong with this code, assuming 'aboutContent' is a valid pointer to an object.
It is a valid pointer as it has an address. Something down the line falls apart though. But I'm not involved at that point.
This error is usually related to some memory issue. I definitely somehow caused it. – 4thSpace Mar 13 '09 at 23:25.
You can try running your app with Guard Malloc on the simulator, but that's not guaranteed to turn up anything. I'd suggest you just start commenting out statements until you find the one that's causing the error.
It's not clear what's going on with the code snippet you've just provided without more context. That said, it looks like all you want to do is load some HTML locally in the device. Why not just do this?
- (void)viewDidLoad { webView loadRequest:NSURLRequest requestWithURL:NSURL fileURLWithPath:NSBundle mainBundle pathForResource:@"help/about. Html" ofType:@"html"isDirectory:NO; } Using this technique, you can author HTML-based documents right in your phone without the user being wise to the fact that they are actually looking at a web view: this includes Javascript, CSS, the whole ball of a wax. I've seen people actually have their iPhone app go out to the Internet just to render a static page on the Internet which really is not necessary.
From your sample code in the second post, the button you release UIBarButtonItem *button is not retained by anything following the release you have commented out - and so it is deallocated. You need to add the button to another view (using adSubview) in order for it to display and then you can release it. The parent view will retain the button.
Of course if you are going to refer to the button again, your view controller should keep the retain and release the button in its dealloc.
I've the problem but am not clear on a solution. The following is on RootViewController and loads the next view, which is where the error occurs...I think. Not exactly clear on that either.
-(void)showAbout:(id)sender{ UIBarButtonItem *button = UIBarButtonItem alloc initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:nil action:nil autorelease; self.navigationItem. BackBarButtonItem = button; //causes about view to crash. //button release; AboutViewController *aboutView = AboutViewController alloc initWithNibName:@"About" bundle:nil; delegate.
NavigationController pushViewController:aboutView animated:YES; aboutView release; } Following memory management rules, I release button since I alloc'd it. Why does this cause EXC__BAD_ ACCESS? The scope of button is only within the method.
I tried putting its release as the last line above but that didn't help.
1 For the purpose of the memory management rules, "autorelease" is the same as "release". (It really just means "release later". ) So you effectively released the button twice, which will certainly cause a crash.
– Brent Royal-Gordon Mar 14 '09 at 2:21.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.