I donβt know why you got this answer, but when I read your question I tried in my project, but I get the value
UIButton *btnTemp = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; btnTemp.tag = 1; int iTag = btnTemp.tag;
Out put
2012-03-26 10:32:02.899 Leaves[506:f803] Str 1 2012-03-26 10:32:02.901 Leaves[506:f803] Str 1
both give me 1
source share