Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BarryK88

macrumors member
Original poster
Mar 1, 2011
31
0
I'm trying to save the positions of several images whom are inside my view. How can i store the coordinates of the images so that when the App launches the images are still at the same location?

Thanks in advance!
 

BarryK88

macrumors member
Original poster
Mar 1, 2011
31
0
I'd look at saving a NSMutableDictionary to your apps sandboxed area. You can easily store CGPoints as NSNumbers

Is this function able to get the coordinates by itself. I'm using drag functions on the images inside my view and like to store their coordinates when dragged.

Can you provide me with an example.

Many thanks!
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Can you provide me with an example.

No. I fundamentally believe that it does not help. People just copy and paste without learning anything about the code they are copying or how to help themselves. I have suggested a starting point. Look up those classes in the documentation. Figure out how to use them. Look at the guides in the documentation. Everything you want to do is covered in there.

If you have specific questions about individual methods/functions then post code and I'll try and answer.
 

xStep

macrumors 68020
Jan 28, 2003
2,031
143
Less lost in L.A.
Did something like this just this week. I decided that NSMutableDictionary was overly complicated so I used an NSMutableArray and handled the offset when iterating through the list.

The reason to use NSNumber is because the NS dictionaries and arrays only handle objects, so you need to convert your CGPoints to an an object that is then added to your collection object.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.