Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 4, 2008, 07:00 PM   #1
belsokar
macrumors member
 
Join Date: Jul 2005
How to Redraw View after UIActionSheet

So I currently am using a UIViewController to manage a view.

On that view, I have a button that opens up a UIActionSheet.

After setting that Action sheet, I have some code in my ViewWillAppear method that doesn't get called on a UIActionSheet close.

I have figured out how to reload a tableview, but for some reason, there doesn't seem to be something similar for a standard view. I basically want to refresh the view so it calls out the ViewWillAppear code segment on my page.

thanks!
belsokar is offline   0 Reply With Quote
Old Aug 4, 2008, 08:25 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Use the UIActionSheet delegate methods to determine when the alert has dismissed, and then you can update a view via the setNeedsDisplay method (or just call viewWillAppear manually).
kainjow is offline   0 Reply With Quote
Old Aug 5, 2008, 12:18 PM   #3
belsokar
Thread Starter
macrumors member
 
Join Date: Jul 2005
Thanks, I didn't catch those actionSheet delegates the first time.

So I setup the following action sheet delegate:

didDismissWithButtonIndex:

and that delegate is successfully called, and I tried the following:

[self.view setNeedsDisplay];

However, that doesn't seem to force a re-display, as I would expect my viewWillAppear to be called, and it isn't.

Any ideas? I haven't tried calling viewWillAppear manually, but I will try that as well I suppose.
belsokar is offline   0 Reply With Quote
Old Aug 5, 2008, 03:56 PM   #4
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Well, what's actually changing that needs redisplaying? What are you expecting it to do?
kainjow is offline   0 Reply With Quote
Old Aug 5, 2008, 06:00 PM   #5
belsokar
Thread Starter
macrumors member
 
Join Date: Jul 2005
Quote:
Originally Posted by kainjow View Post
Well, what's actually changing that needs redisplaying? What are you expecting it to do?
I have a dual mode button. In state 1, the name of the button is "Button 1" for example. When I press the button the first time, it displays the UIActionSheet. Depending on the selection within the ActionSheet, I then change the state of the button to to state 2, with new text "Button 2".

If I navigate away from the view and back, it is fine because I declare the title text for the button in the ViewWillAppear method. Upon exiting the action sheet however, I am just trying to force the view to redraw/reload so that the new button state is reflected.

thanks!
belsokar is offline   0 Reply With Quote
Old Oct 9, 2008, 09:02 AM   #6
dekelver
macrumors newbie
 
Join Date: Oct 2008
How to Redraw View after UIActionSheet

I'm looking to do the same thing, I've got a view that I want a user to click to reveal something underneath it. After about 2 seconds I want it to switch back to what it was, but I don't want to stop the users from doing other things in the mean time. And I want them to see an animation when they click it, and when it shifts back.

I've got the NSTimer set up to handle the switch back, and the method is firing correctly after 2 seconds. But the UI doesn't update. I need some way of forcing the UI to redraw itself, or forcing it to update when the 2 seconds are done.

Help?
dekelver is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

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 On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
How to convince my parents to let me buy a 17" MacBook Pro Ulf1103 Buying Tips and Advice 58 Nov 27, 2013 11:45 AM
Tutorial: How to get PCSX2 to run on Mac (without BootCamp) Mirrors Mac Applications and Mac App Store 22 Jun 14, 2013 08:19 PM
[HOW TO] DIY iPhone 4 Swivel Car Mount QuarterSwede iPhone Accessories 13 Mar 8, 2011 02:51 PM
How to switch View after pressing a Navigation Button RottenApple2 iPhone/iPad Programming 1 Nov 4, 2009 05:09 AM
Core Data, how to refresh views after object save? gigantor Mac Programming 4 Oct 15, 2008 06:19 AM


All times are GMT -5. The time now is 07:43 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC