Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Object ID Identity attribute?

  1. In the IB under Identity tab you can find an attribute called "Object ID". I can not find a way to get hold of this ID from code. Oh, and I know about the tag attribute but it's not what I need.

  2. I essentially would like to get the unique object ID for a UIComponent that was touched on the sceen. I already have the UITouch object.

like image 965
Cyprian Avatar asked Oct 18 '10 11:10

Cyprian


People also ask

How do I find the ID of an object?

Find User (Object ID) Browse to or search for the desired user, then select the account name to view the user account's profile information. The Object ID is located in the Identity section on the right. Find role assignments by selecting Access control (IAM) in the left menu, then Role assignments.

What is object ID in Ruby?

For every object, Ruby offers a method called object_id. You guessed it, this represents a random id for the specific object. This value is a reference of the address in memory where the object is store. Every object has a unique object id that will not change throughout the life of this object.


2 Answers

For UIView I normally use the tag property.

- (IBAction) buttonPressedid) sender {
NSLog(@"tag: %i", [sender tag]);
}

I'm pretty sure you can set the tag property in IB :)

like image 39
willcodejavaforfood Avatar answered Oct 18 '22 15:10

willcodejavaforfood


The Object ID in Interface Builder is only an internal book-keeping value used by IB when deserializing/serializing XIB files, and does no longer exist when the Application runs.

You want to use tag, or alternately, a property/outlet.

like image 102
Williham Totland Avatar answered Oct 18 '22 13:10

Williham Totland