Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-30-2012, 05:58 AM   #1 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 98
SteveMobs is on a distinguished road
Question wait_fences problem with UIAlertView

When the home button is pressed while an alert view is shown, I revceive a wait_fences: failed to receive reply: 10004003 error message. What does this mean? It even happens I an app as simple as this:
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
    window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [window makeKeyAndVisible];
    UIAlertView *changeAlert = [[UIAlertView alloc] initWithTitle:@"test"
                                                          message:nil
                                                         delegate:nil 
                                                cancelButtonTitle:@"cancel" 
                                                otherButtonTitles: nil];
    [changeAlert show];
    [changeAlert release];
    return YES;
}
The error comes right after applicationDidEnterBackground being called.

What does this mean? What's a correct way to show an alert view that is 'Home button resisten'?

Thanks!
SteveMobs is offline   Reply With Quote
Old 01-30-2012, 06:22 AM   #2 (permalink)
Registered Member
 
apatsufas's Avatar
 
Join Date: Jan 2011
Location: Thessaloniki, Greece
Posts: 121
apatsufas is on a distinguished road
Default

I'm not sure if this is causing the error but take a look at the iOS App Programming guide here
In the App States and Multitasking section Apple states that
Quote:
Clean up resources for active alerts when moving to the background. In order to preserve context when switching between apps, the system does not automatically dismiss action sheets (UIActionSheet) or alert views (UIAlertView) when your app moves to the background. It is up to you to provide the appropriate cleanup behavior prior to moving to the background. For example, you might want to cancel the action sheet or alert view programmatically or save enough contextual information to restore the view later (in cases where your app is terminated).

For apps linked against a version of iOS earlier than 4.0, action sheets and alerts are still dismissed at quit time so that your app’s cancellation handler has a chance to run.
__________________
SQLed - Your Database Manager on the go

iAZConverter - Converts everything from A to Z
apatsufas is offline   Reply With Quote
Old 01-30-2012, 06:32 AM   #3 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 98
SteveMobs is on a distinguished road
Default

Thanks, I found something similiar in the UIAlertView Class Reference:
Quote:
Important In iOS 4.0 and later, alert views are not dismissed automatically when an application moves to the background. This behavior differs from earlier versions of the operating system, where alert views were automatically cancelled (and their cancellation handler executed) as part of the termination sequence for the application. Now, it is up to you to decide whether to dismiss the alert view (and execute its cancellation handler) or leave it visible for when your application moves back to the foreground. Remember that your application can still be terminated while in the background, so some type of action may be necessary in either case.
Actually, I want my alert view to be visible after the app is back in the foreground. I freaking out right now. No matter how and were I show an alert view, I always get this wait_fences error.

I found some threads which recommend to call the selector showing the alert view with a delay. This didn't work either.

Can someone post a simple class with an alert view, that does not cause this errror, please?
SteveMobs is offline   Reply With Quote
Old 01-30-2012, 06:41 AM   #4 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 98
SteveMobs is on a distinguished road
Default

I just downloaded the "LaunchMe" sample app from apple... when the app start, an alert view is shown immediately. Pressing the home button results in ... wait_fences: failed to receive reply: 10004003



Help!
SteveMobs is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 417
17 members and 400 guests
Atatator, chiataytuday, condor304, dre, FrankWeller, imac74, ipodphone, jeroenkeij, kukat, LunarMoon, mraalex, n00b, PowerGoofy, QuantumDoja, Retouchable, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,675
Threads: 94,124
Posts: 402,909
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Retouchable
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:01 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0