0

Total newb here.

What is the difference between this

_myUIProgressView.transform = CGAffineTransformScale(_myUIProgressView.transform, 1.0, 0.3);

and this:

[_myUIProgressView setTransform:CGAffineTransformMakeScale(1.0, 0.3)];

besides the brevity. Why would you favor one over the other?

4

1 回答 1

0

Those 2 calls are functionally identical. The only difference is syntax.

The first is called dot notation. The second is a method call to the setter.

Dot notation is an alternative way to invoke a property's setter or getter, and it does exactly the same thing as the other syntax.

Some people (mostly old school C programmers) don't like the dot syntax. I'm an old C programmer, but I like it.

于 2013-09-27T23:04:40.677 回答