Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Mobile Development > BOOK: Beginning iOS 4 Application Development
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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).
Reply With Quote
  #2 (permalink)  
Old June 17th, 2011, 09:24 AM
Friend of Wrox
Points: 1,671, Level: 16
Points: 1,671, Level: 16 Points: 1,671, Level: 16 Points: 1,671, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #3 (permalink)  
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..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:48 AM.


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