Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6929353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:18:22+00:00 2026-05-27T11:18:22+00:00

I am new to iPhone application development. I wrote code to draw and erase

  • 0

I am new to iPhone application development.

I wrote code to draw and erase but, I am unable to do the undo and redo operations.

I used am using CoreGraphics in my application. Please help me to fix the undo redo issue.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:18:23+00:00Added an answer on May 27, 2026 at 11:18 am

    I put together a little sketching app in Flash a few years ago and implemented undo/redo functionality. I don’t know that this is the right way of doing it (probably not), but I can give you a high level view of what I did.

    The basic concept is this (like Andy mentioned): Have a stack of recently executed actions. If you can, have your “undo” action truly undo the last action. Put this “undo” action into a different stack, so that you can provide “redo” functionality. When someone clicks “redo”, do the same thing but in reverse — execute the action in the “redo” stack and put that into the other stack. Once someone does something new (i.e., not “redo” or “undo”), get rid of the “redo” stack and start adding to the main stack.

    What was interesting for me was that I couldn’t figure out a way to truly “undo” an action (i.e., I didn’t know how to undraw a stroke). What I did instead was I drew all the strokes up to the last action. As you can imagine, that’s not very efficient. I made it more efficient by having stacks of stacks. That way, the latest “undo” action would only have to undo the last stack’s worth of actions, instead of the entire history of all the actions.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to iPhone Application Development , I am using XCode 4.2 with
I'm pretty new to iPhone application development and I'm doing well so far. But
I am new to iPhone development. I want to create an iPhone application, using
I have done some iPhone application development but still am relatively new at it.
I am new to iphone development, i have created sms application using Text Links(sms:)
I am new to iPhone application development. In the application that I am developing
I'm new to iPhone and Apple development and working on my first application. It
I am new to iphone development. In my application, I have address for a
I am new to iphone application development. I am building an iphone app where
I am new in iphone application development.Please tell me how i check through our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.