Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Beginning iOS 4 Application Development
|
BOOK: Beginning iOS 4 Application Development
This is the forum to discuss the Wrox book Beginning iOS 4 Application Development by Wei-Meng Lee; ISBN: 978-0-470-91802-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iOS 4 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 16th, 2011, 10:12 AM
Registered User
 
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 3 - Using Views - wait_fences: failed to receive reply: 10004003

Program compiles and runs. When using simulator, I get "wait_fences: failed to receive reply: 10004003" error when I 'push' any button. I've tried to look up this error but, frankly, am totally confused on why it is occurring.

Note, program also crashes on phone.

Any advice would be appreciated. (Using xCode 4).
 
Old June 17th, 2011, 09:24 AM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

I am assuming you are referring to the display of the UIAlertView. You are not specific. In a previous version of this book, "Beginning iPad Application Development" there is a small program demonstrating this view that causes this error. The problem there is the location of the code for displaying the alertView. The call to show the alertView is placed in the -viewDidLoad method, which precedes the call in the appDelegate to show the window. The view is trying to display without being on screen. If you move the method to the appDelegate as follows, the warning will be eliminated.

Code:
#import "UsingViewsAppDelegate.h"

#import "UsingViewsViewController.h"

@implementation UsingViewsAppDelegate


@synthesize window=_window;

@synthesize viewController=_viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    
    self.window.rootViewController = self.viewController;    
    [self.window makeKeyAndVisible];
    UIAlertView *alert = [[UIAlertView alloc]
                          initWithTitle:@"Hello"
                          message:@"This is an alertView"
                          delegate:self
                          cancelButtonTitle:@"OK"
                          otherButtonTitles:nil];
    
    [alert show];
    [alert release];
    return YES;
}
Keep in mind that the book's use of the alertView is totally impractical. I can't imagine a situation where an alertView would be called as the initial display of a program.

If your issue is not related to this, please be more specific.

Bob
 
Old June 17th, 2011, 11:55 AM
Registered User
 
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Last edited by grmensz; June 17th, 2011 at 11:57 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 5 -Scrolling Views improvement bartelt BOOK: Beginning iPad Application Development 0 June 25th, 2010 03:13 AM
converting Access 2000 views to Sql views matta Classic ASP Professional 1 January 26th, 2005 03:37 PM
How Can I Receive Mail By C#? shenyisyn VS.NET 2002/2003 2 January 5th, 2005 05:18 AM
TCPSend/ Receive system.dll problem (ch 20) dingke BOOK: Professional C#, 2nd and 3rd Editions 0 March 10th, 2004 05:42 PM
How to receive all parameters eapsokha Classic ASP Professional 1 February 17th, 2004 10:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.