Question: Is it dangerous to cast "(NSInteger)self"?

I need to distinguish two views, not using tag value.

If It is dangerous, any ideas?

Answer: 
You mean you have two `UIView` pointers and you want to know if they are pointing to the same object? Just use `==`. No need to cast them. If you mean something else, you'll need to provide more details on what you mean by "distinguishing two views".
Ignoring what convulsions ARC may go through, it's not dangerous to cast `self` (or any other pointer) to `integer`. It is exceedingly dangerous, however, to cast the other direction.

And Objective-C has enough odd corners and dark hallways that it's difficult to say with great confidence that `self` cast to an integer will be reproducible in a useful way.