本文由 发布,转载请注明出处,如有问题请联系我们! 发布时间: 2021-05-26Objective-C 中不带加减号的方法
加载中Objective-C 中没有加减号的方式
不言而喻的客观事实是,Objective-C 中, 但看他人编码全过程中,还会继续发觉一种,没有加减号的方式。 @implementation MyViewController void foo(){ printf("msg from foo..."); } - (void)loadView { [super loadView]; foo(); } @end 这类是配搭的 C 编码。 自然当 C 方式写在 void foo(){ printf("msg from foo..."); } @implementation MyViewController - (void)loadView { [super loadView]; foo(); } @end C 中获得 Objective-C 的数据信息但假如你觉得将 C 编码写在 MyViewController.h @interface MyViewController () @property NSString *someStr; @end MyViewController.m @implementation MyViewController // void foo() { printf(self.someStr); } // |