-2

What does this line represent? Please any one explain about | symbol?

self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
peko
  • 11,199
  • 4
  • 32
  • 47
Maniganda saravanan
  • 2,148
  • 1
  • 18
  • 35

1 Answers1

1

| is bitwise OR operator.

You can find more on it here.

the values of both the constanst are as, it find bitwise on them.

UIViewAutoresizingFlexibleWidth  = 1 << 1 //2

UIViewAutoresizingFlexibleHeight = 1 << 4 //16

This will be :

UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight = 18
Anoop Vaidya
  • 45,913
  • 15
  • 108
  • 138
  • @downvoter : why downvote? – Anoop Vaidya Mar 15 '13 at 12:32
  • @peoplewhoanswertothis. why didn't you downvote and mark this question as duplicate or to localized. because the only thing you care about is youre score. thats why i downvoted you – peko Mar 15 '13 at 12:45
  • @peko: Happy to see your comment, I dont think this answer is dupe to that C/C++/C#/java question, I explicitly defined the meaning of each constants. – Anoop Vaidya Mar 15 '13 at 12:50
  • not youre answer is a dupe. youre answer is fine and well explained like most of youre answers. its the question – peko Mar 15 '13 at 12:58
  • @peko: so you are expecting much from this answer? should i add few more explanation to it? – Anoop Vaidya Mar 15 '13 at 13:02