tags:

views:

21

answers:

1

Hi, I am having a following problem.

  1. When a certain touch occures on a UIVIew, I want to store this UIView's unique identifier (like let's say objectID) so that when I reopen my app again I can check if in the visible UIViews there is the one UIView with the unique ID from the storage. I do not want to store the tag values as object ids because they may not be unique and they are manualy set up. I need to get a unique identifier that is automatically assign by the system. Any ideas hot to get it?
A: 

They don't have a unique identifier that will be the same each time the app is run.

What does the UIView represent i.e. someone's name? Store that piece of information instead and re-create the view when the app next starts up.

deanWombourne
I am unable to know what resides inside the UIView and what is its purpose b/c I am building a generic UIView reader. I am trying to build a UIView graph that has a reference to any UIView in an app.
Cyprian
OK, that makes it more tricky :) Try calling the `hash` method on your UIView - it's not _guaranteed_ to be unique but the chance of it repeating are so small it will probably do the job for you.
deanWombourne