03 2014 档案
摘要:#import MFMessageComposeViewControllerDelegate#pragma mark - 调用ios系统短信发送模块-(void)shareUseSMSWithMessage:(NSString *)message{ Class messageClass = (NSClassFromString(@"MFMessageComposeViewController")); if (messageClass != nil) { // Check whether the current device is configured for send...
阅读全文
摘要:// 触摸背景关闭软键盘- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [super touchesBegan:touches withEvent:event]; [self.view endEditing:YES];}
阅读全文
摘要:if ([[[UIDevice currentDevice]systemVersion]floatValue] >= 7.0) { [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithHexString:@"0b6aff"]]; } else { self.navigationBar.tintColor = [UIColor colorWithHexString:@"0b6aff"]; }
阅读全文
摘要:-(void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{ NSLog(@"Country = %@", placemark.country); ...
阅读全文
摘要:UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 75.0f, 30.0f)]; UIButton *editorCityBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [editorCityBtn setFrame:CGRectMake(0.0f, 0.0f, 30.0f, 30.0f)]; [editorCityBtn setBackgroundImage:MF_PngWithS...
阅读全文
摘要:for(int i = 0;i<[view.subviews count];i++){[ [ view.subviews objectAtindex:i] removeFromsuperview];}
阅读全文
摘要:#import @interface TabBarViewController : UITabBarController+ (TabBarViewController *)sharedTabBarController;@end#import "TabBarViewController.h"#import "FirstViewController.h"#import "SecondViewController.h"#import "ThirdViewController.h"@interface TabBarView
阅读全文
摘要:// 判断设备是否有通话功能 NSString *deviceType = [UIDevice currentDevice].model; if([deviceType isEqualToString:@"iPod touch"]|| [deviceType isEqualToString:@"iPad"]|| [deviceType isEqualToString:@"iPhone Simulator"]) { UIAlertView *alert=[[UIAlert...
阅读全文
摘要:// 判断设备是否有发送邮件功能 NSString *deviceType = [UIDevice currentDevice].model; if([deviceType isEqualToString:@"iPod touch"]|| [deviceType isEqualToString:@"iPad"]|| [deviceType isEqualToString:@"iPhone Simulator"]) { UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@&quo
阅读全文
摘要:- (NSMutableArray *)QuickSort:(NSMutableArray *)list StartIndex:(NSInteger)startIndex EndIndex:(NSInteger)endIndex{ if(startIndex [temp1 intValue]){ tempIndex = tempIndex + 1; [list exchangeObjectAtIndex:tempIndex withObjectAtIndex:i]; } } ...
阅读全文
摘要:VoiceNavigationViewController.m* 客户端需安装百度导航地图#import "VoiceNavigationViewController.h"#import "BMapKit.h"#import "BMKNavigation.h"@interface VoiceNavigationViewController (){ BMKMapView* _mapView;}@end@implementation VoiceNavigationViewController- (id)initWithNibName:(N
阅读全文
摘要:#define SNOW_IMAGENAME @"snow"#define IMAGE_X arc4random()%(int)Main_Screen_Width#define IMAGE_ALPHA ((float)(arc4random()%10))/10#define IMAGE_WIDTH arc4random()%20 + 10#define PLUS_HEIGHT Main_Screen_Height/25#import "ViewController.h"@interf...
阅读全文
摘要:#define SNOW_IMAGENAME @"snow"#define IMAGE_X arc4random()%(int)Main_Screen_Width#define IMAGE_ALPHA ((float)(arc4random()%10))/10#define IMAGE_WIDTH arc4random()%20 + 10#define PLUS_HEIGHT Main_Screen_Height/25#import "ViewController.h"@interf...
阅读全文
摘要:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ UILocalNotification *notification = [[UILocalNotification alloc] init]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"HH:mm:ss"]; //...
阅读全文
摘要:LoadingView.h#import @class MBProgressHUD;@interface LoadingView : NSObject@property (nonatomic, retain) MBProgressHUD *HUD;+ (LoadingView *)sharedInstance;/** * 加载中提示框 * * @param title 标题 * @param superView 父View */- (void)showLoadingViewWithTitle:(NSString *)title superView:(UIView *)superV...
阅读全文
摘要:Block.h#import typedef void(^SuccessBlock)(id result);@interface Block : NSObject+(void)passValue:(NSString *)str success:(SuccessBlock)success;@endBlock.m#import "Block.h"@implementation Block+(void)passValue:(NSString *)str success:(SuccessBlock)success{ success(str);}@end// 使用[Block pas
阅读全文
摘要:catgory 允许你为一个已经存在的类增加方法,而不需要增加一个子类。而且不需要知道它内部具体的实现。另外,虽然Category不能够为类添加新的成员变量,但是Category包含类的所有成员变量,即使是@private的。Category可以重新定义新方法,也可以override继承过来的方法。Extensions 声明必须在@implementation在实现。category和extensions的不同在于extensions可以添加属性。另外extensions添加的方法是必须要实现的。
阅读全文
摘要:1、dispatch_asyncdispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSURL * url = [NSURL URLWithString:@"http://avatar.csdn.net/2/C/D/1_totogo2010.jpg"]; NSData * data = [[NSData alloc]initWithContentsOfURL:url]; UIImage *image = [[UIImage alloc]initWithDa...
阅读全文
摘要:简单的理解:V对M是不能通讯的。C对M通讯:APIM对C通讯:Notification,KVOC对V通讯:OutletV对C通讯:Target-action, Delegate,Datasource
阅读全文

浙公网安备 33010602011771号