iOS static

时间:2021-10-19 05:55:53

获得20条news

先实现,再提取到business 层。

The static Keyword

You can have a local variable retain its value through multiple invocations of a method by placing the keyword static in front of the variable's declaration.

Remember that static or local variables can be accessed only from within the method in which they're defined.You can move the static variables outside any method declaration to make it accessible to any methods.

#import "Printer.h" static int pageCount;
@implementation Printer ...
@end

找书的流程有优化

赞赞赞!