views:

1063

answers:

3

Hi,

I'm trying to take a snapshot of the iPhone simulator when a row in a table view is selected, before the new view appears. I have been unable to find a point where I can stop the simulator, with the row selected, so that I can take a snapshot of it. How do I do that?

Thanks for your time.

+1  A: 

This is a long shot but I noticed that on iPhone when you touch but not release the row gets selected but you don't get transitioned to new view until you lift your finger. Now on simulator on Mac (I assume) if it works the same way you may be able to set time out on your capture tool for a couple of seconds and then select the row and hold the mouse button down until the time out takes the snapshot. I was able to do similar stuff on other (not so popular) system but don't remember now if it works same way on Mac.

stefanB
A: 

Try using the OS's screen capture facilities. For example, open Preview and choose File > Grab > Timed Screen, then switch back to the iPhone Simulator and hold the mouse button down on the row in the table view until the screen flashes. If you're more of a command-line person, try something like:

screencapture -T 2 foo.png & ; open -a 'iPhone Simulator'
Nicholas Riley
Thanks stefanB and Nicholas Riley. Those were great solutions I didn't think of.
+1  A: 

I assume you have the source code; Just comment out the code that does something when you select the row temporarily (- (void) tableview:didSelectRowAtIndexPath:), click the row, take the screenshot, uncomment the code.

Unless you call [tableview deselectRowAtIndexPath:animated:] the row will remain selected as long as the view is shown.

Ed Marty
Thank you. Exactly what I wanted.