MTStatusBarOverlay 的使用

高砚
2023-12-01

https://github.com/myell0w/MTStatusBarOverlay/

库地址。


我在xcode4.2-ios5下测试使用,不使用arc。

我按照文档中说的,做的。

If you use MTStatusBarOverlay in a non-ARC project, add "-fobjc-arc" to the Compiler Flags of MTStatusBarOverlay.m in your target's "Build Phases" tab under Compile Sources.

这样在ios5下运行是没有问题的,但是要编译在ios4下运行,还需要加入一个参数

you have to add "-fobjc-arc" to "Other Linker Flags" of your projec
需要在link里加这个,搞定!!

否则执行代码,程序就闪退了。

使用上:

// shows an activity indicator and the given message

- (void)postMessage:(NSString *)message;

- (void)postMessage:(NSString *)message duration:(NSTimeInterval)duration;

- (void)postMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated;

- (void)postMessage:(NSString *)message animated:(BOOL)animated;

// clears the message queue and shows this message instantly

- (void)postImmediateMessage:(NSString *)message animated:(BOOL)animated;

- (void)postImmediateMessage:(NSString *)message duration:(NSTimeInterval)duration;

- (void)postImmediateMessage:(NSString *)message duration:(NSTimeInterval)duration animated:(BOOL)animated;


像这样的函数就有3组,还有两个是finish和error的,应该只是显示出来进度还是勾勾之类的。

使用上需要注意一点,- (void)postMessage:(NSString *)message;这个函数,是要手动去调用hide函数来结束的。如果在结束之前,又执行了一此其他的post就会导致这样的错误。

 Assertion failure in -[_UITableViewUpdateSupport _computeRowUpdates], /SourceCache/UIKit_Sim/UIKit-1912.3/UITableViewSupport.m:386

2012-02-03 11:47:30.856 SBTableTest[1024:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid table view update.  The application has requested an update to the table view that is inconsistent with the state provided by the data source.'



 类似资料: