Note that there are some explanatory texts on larger screens.

plurals
  1. POStoring CGPoints in NSMutableArray and Sqlite
    text
    copied!<p>I would like to store the points whenever touchesMoved is called. So far everything is working fine. However what I want to do is to create a "new" array every time touchesMoved is called. For example, once the touch ended the array of points are then saved into database with an identifier of 1. The next time the touchesMoved is called, the array is emptied and replaced with another set of points with a different identifier. I tried incrementing an integer in touchesEnded every time it is called, but I figured out that the integer will remain the same every time the touch ended. So how will I do this? Any help will be very much appreciated.</p> <p>UPDATE: For example I have this recorded points in my array:</p> <pre><code>100.000, 200.000 100.000, 202.000 100.000, 204.000 </code></pre> <p>This points will be saved in the database with a identifier, let's say 1.</p> <pre><code>1 | 100.000 | 200.000 1 | 100.000 | 202.000 1 | 100.000 | 204.000 </code></pre> <p>Now, when the touches moved and ended again, the new set of recorded points will be saved with a different identifier, let's say 2.</p> <pre><code>2 | 200.000 | 300.000 2 | 200.000 | 302.000 2 | 200.000 | 304.000 </code></pre> <p>So basically what I want to happen is that every time the touchesMoved is called, it will record points that will be saved in an array. When the touches ended, this recorded points will be saved with an identifier. AND, once the touchesMoved is called again and ended, the new set of recorded points will be saved with a different identifier. Any ideas how to do it?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload