search

Home  >  Q&A  >  body text

Class extension implementation must be in the original class, what is the significance? objective-c

There is a person class. Write another extension: Person_testExt.h, but only .h file. I added a - (void)run method. But the implementation still has to be in Person.m.
So if you write an extension to NSString, and if you implement this method, does it need to be in the original .m file? So what's the point of expansion?

仅有的幸福仅有的幸福2829 days ago758

reply all(1)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-02 09:38:52

    You can use category

    reply
    0
  • Cancelreply