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

Similar Threads
thread Thread Starter Forum Replies Last Post
General: Development Question: Creating a FlipSwitch Toggle with a UIActionSheet tateu Jailbreaks and iOS Hacks 0 Feb 7, 2014 11:16 AM
Redraw issue in Mail llancit Mac Applications and Mac App Store 0 Sep 17, 2013 09:27 AM
Resolved: UIActionSheet Takes 20 seconds to appear newtoiphonesdk iPhone/iPad Programming 2 Jan 12, 2013 10:14 AM
draw/redraw: a powerful, flexible, beautiful drawing app. SteppingStone iPad Apps 3 Aug 28, 2012 07:25 AM
Connecting from a UIActionSheet? Fritzables iPhone/iPad Programming 0 Jun 20, 2012 10:03 PM

Forum Jump

All times are GMT -5. The time now is 04:54 AM.

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

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