search

Home  >  Q&A  >  body text

objective-c - myrectgle.origin=mypoint; 这条语句是怎么调用图片中的setOrigin方法的?

怪我咯怪我咯2766 days ago523

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-24 09:13:22

    myrectgle is an object. myrectgle.origin =xxx sets myrectgle.origin through the dot method. If you use @property when declaring origin, the compiler will automatically generate a - (void)setOrigin:(XYPoint *)pt method; if you write it again in the m file - (void)setOrigin:(XYPoint *)pt is equivalent to repeating After writing this method, setting the origin through the dot method will call this method;

    reply
    0
  • Cancelreply