Difference between [object variable] and object.variable in Obj-C?
- by John Smith
I was working on a program today and hit this strange bug. I had a UIButton with an action assigned. The action was something like:
-(void) someaction:(id) e
{
if ([e tag]==SOMETAG)
{
//dostuff
}
}
What confuses me is that when I first wrote it, the if line was
if (e.tag==SOMETAG)
XCode refused to compile it, saying
…