Sorry about not being more specific.
Code specifically is
Code:
#import "UsingViewsViewController.h"
@implementation UsingViewsViewController
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSLog(@"%d", buttonIndex);
}
- (void)dealloc
{
[super dealloc];
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
UIAlertView *action = [[UIAlertView alloc]
initWithTitle: @"Hello"
message:@"This is alert view"
delegate: self
cancelButtonTitle: @"OK"
otherButtonTitles: @"Option 1", @"Option 2", nil];
[action show];
[action release];
[super viewDidLoad];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
Have found that the 'wait_fences' error occurs only on 4.2 simulator, not iPhone. When I said problem occurred on iPhone I was misunderstanding what was going on. Interestingly, if I put breakpoint on the show and release, and run the program on the simulator and continue the program, there is no error.
I guess this shows the importance of running on actual hardware.
In trying to research this problem, I am amazed that of the dozens of messages mentioning this, not ONE describes what the error means so you have little way to deal with the issue. Your explanation is the first (although I am not sure I really understand how that applies to the code I have included).
Bottom line is that, as you say, you would not use this technique.
Thank you so much! I've got a lot to learn.
Gary