 |
BOOK: Professional iPhone and iPad Database Application Programming
 | This is the forum to discuss the Wrox book Professional iPhone and iPad Database Application Programming by Patrick Alessi; ISBN: 978-0-470-63617-6 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional iPhone and iPad Database Application Programming 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
|
|
|
|

March 15th, 2012, 09:29 AM
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 8
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Chapter 3 - long proces by 500 entries - alertView
Dear Bob, I need your help again. I press a button and then get the table view to see. Now I have over 200 entries with different graphics. This takes on an iPhone 3G for about 3 seconds. I would like to distribute the user with a showAlertx and UIActivityIndicatorView time. Unfortunately this is impossible. Can you help me please?
Thank you very much, Michael
Here is my code:
[self showAlert];
-(void)showAlert{
alert = [[[UIAlertView alloc] initWithTitle:@"Please Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];
[alert show];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicator ViewStyleWhiteLarge];
indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50);
[indicator startAnimating];
[alert addSubview:indicator];
[indicator release];
}
-(void)dismissAlert{
[alert dismissWithClickedButtonIndex:0 animated:YES];
[alert release];
}
|
|

March 16th, 2012, 08:33 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
|
|
I don't think using an alertView is the right way to display the activity indicator, and with the way you have it set up there is no way to manually dismiss the alertView since it has no buttons. I assume that you intend to dismiss it programmatically when the tableView has finished loading. I would create a view to overlay on the tableView with the text and activity indicator and add it when the tableView is loading, dismissing it when the loading is complete.
Second, since your alertView is autoreleased, it should not be released again in your -dismissAlert method.
Checkout
http://fromideatoapp.com/blueprint-homepage/
Download the Part 4: Custom Animations Demo and see how the "Countdown" tab approaches the situation. Is this similar to what you are trying to achieve?
Bob
|
|
The Following User Says Thank You to thepianoguy For This Useful Post:
|
|
|

March 17th, 2012, 12:25 PM
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 8
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Hi Bob,
many thanks for your expert answer.
The reference to "Custom Animation Demo" is very interesting. My problem is I think that (synchronous?) Simultaneous display of the activity indicators and the loading of tableView. The view will remain for about 3 seconds to stand around the tableView is displayed, and this time I would like to display an activity indicator.
Unfortunately I do not get us anywhere.
Thank you very much, Michael
|
|

March 18th, 2012, 08:07 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
|
|
The project I referred you to is more about creating a "look" for an overlay to your tableView when presenting your activity indicator, since I think the UIAlertView is not what should be used.
Concerning the calling and dismissing of the activity indicator, is your tableView already on the screen and reloading, or is it making its initial appearance? We will need to determine what delegate methods or notifications can be used to summon and then dismiss the overlay.
Bob
|
|
The Following User Says Thank You to thepianoguy For This Useful Post:
|
|
|

March 18th, 2012, 08:26 AM
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 8
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Hi Bob,
tableView is the first time charged from a subView and is it making its initial appearance.
- (TestTableViewController *)testTableViewController {
// [self showAlert];
// Instantiate the view controller if necessary.
if (rednerTableViewController == nil) {
testTableViewController = [[TestTableViewController alloc] initWithNibName:@"TestThemaListeView" bundle:nil];
}
return testTableViewController;
}
Have a nice sunday, Michaael.
|
|

March 19th, 2012, 12:22 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
|
|
I have done an example project that I believe accomplishes what you want. One version with an overlay and one with an alertView.
Send an email to
[email protected]
and I will reply with the project.
Bob
|
|
The Following User Says Thank You to thepianoguy For This Useful Post:
|
|
|

March 19th, 2012, 12:43 PM
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 8
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Dear Bob,
I've sent you an e-mail.
Thank you.
Best regards, Michael
|
|

March 21st, 2012, 12:37 PM
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 8
Thanks: 6
Thanked 0 Times in 0 Posts
|
|
Dear Bob,
that was exactly what I needed.
Thank you for that.
Michael
|
|
 |
|