iphone-common-codes-ccteam源代码 CCUIApplication.m

//  
// CCUIApplication.m
// CCFC
//
// Created by xichen on 11-12-17.
// Copyright 2011年 ccteam. All rights reserved.
//


#import "CCUIApplication.h"




@implementation UIApplication(cc)




- (void)showStatusBar
{
[self setStatusBarHidden:FALSE];
}


- (void)hideStatusBar
{
[self setStatusBarHidden:TRUE];
}


- (void)showNetworkActivityInStatusBar
{
self.networkActivityIndicatorVisible = YES;
}


- (void)hideNetworkActivityInStatusBar
{
self.networkActivityIndicatorVisible = NO;
}


- (BOOL)getStatusBarNetworkActivityStatus
{
return [self isNetworkActivityIndicatorVisible];
}


// 退出应用程序
- (void)terminate:(int)exitCode
{
exit(exitCode);
}


// open another application
// the anotherAppScheme argument is like "calculator:" which is defined in info.plist file
+ (BOOL)openAnotherApp:(NSString *)anotherAppScheme
{
NSURL *url = [NSURL URLWithString:anotherAppScheme];
return [[UIApplication sharedApplication] openURL:url];
}


// open a url
+ (BOOL)openUrl:(NSString *)url
{
return [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}




@end

 

可能有更新:

googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCUIApplication.m

github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCUIApplication.m

 

posted @ 2012-01-06 09:50  cc_team  阅读(181)  评论(0编辑  收藏  举报