文章分类 - A1-iphone
摘要:跳转模态视图兼容ios5,ios4.3- (void)setWirless{ ConfigureWirelessViewController *vcConfigureWireless = [[ConfigureWirelessViewController alloc] init]; vcConfigureWireless.m_delegateConfigureWireless = self; //创建Nav UINavigationController *navSetWireless = [[UINavigationController alloc] initW...
阅读全文
摘要:UIImage *img = [UIImage imageNamed:@"write_operation_bg.png"];UIImage *imgNew = [img stretchableImageWithLeftCapWidth:20 topCapHeight:20];宽高拉伸20像素
阅读全文
摘要://.h,导入,并添加delegate#import RBDMuteSwitchDelegate//.m//检测当前是否为静音[[RBDMuteSwitch sharedInstance] setDelegate:self];[[RBDMuteSwitch sharedInstance] detectMuteSwitch];//检测是否静音(震动)#pragma mark - - (void)isMuted:(BOOL)muted{ if (muted) { //静音 } else { //正常,设置音量 MPMusicP...
阅读全文
摘要:[[UIApplication sharedApplication] setIdleTimerDisabled: YES];或者[UIApplication sharedApplication].idleTimerDisabled = YES;这样可以有效的控制不允许锁屏,点赞~~
阅读全文
摘要:一//调用if(m_viewScenario.superview == nil){ m_viewScenario.alpha = 1.0; m_viewScenario.transform = CGAffineTransformIdentity; [self zoomIn:m_viewScenario andAnimationDuration:1.0 andWait:YES]; [self.view addSubview:m_viewScenario];} //展示,由小变大- (void)zoomIn: (UIView *)view andAnimationDura...
阅读全文
摘要:NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *comps = nil; comps = [calendar components:NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit fromDate:mydate]; NSDateComponents *adcomps = [[NSDateComponents alloc] init]; ...
阅读全文
摘要:1,- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions下添加 //安装异常捕获#ifdef DEBUG [NSThread detachNewThreadSelector:@selector(startCatchException) toTarget:self withObject:nil];#endif2,- (void)startCatchException{ NSAutoreleasePool *pool ...
阅读全文
摘要:NSThread 有两种直接创建方式:- (id)initWithTarget:(id)targetselector:(SEL)selectorobject:(id)argument+ (void)detachNewThreadSelector:(SEL)aSelectortoTarget:(id)aTargetwithObject:(id)anArgument[NSThread detachNewThreadSelector:@selector(doSomething:) toTarget:self withObject:nil];NSThread* myThread = [[NSThrea
阅读全文
摘要:1.在viewController下面添加如下代码: if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { [self prefersStatusBarHidden]; [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; }- (BOOL)prefersStatusBarHidden{ return YES;}2.在plist里设置:首先设置key:Status bar is initially hid...
阅读全文
摘要:Xcode更新到Xcode5,一运行报如下错误:Unsupported compiler 'com.apple.compilers.llvmgcc42' selected for architecture 'armv7'或'armv7s'解决方案:Change your compiler for C/C++/ObjectiveC Go to Build Settings->Build OPtions->compiler for C/C++/ObjectiveC; select Default(Apple LLVM5.0)
阅读全文
摘要:UIActionSheet最后一个按钮没响应,一般是cancelButton,要稍微向上偏移一点才可以。不过这不是常态,几乎没多少人碰到这个问题,这是在特定情况下才会发生,这个场景就是试用了UITabBar的时候才有。参考:http://stackoverflow.com/questions/2096852/iphone-weird-bug-between-uiactionsheet-and-uitabbar解决办法: UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"您是否拨打" ...
阅读全文
摘要://注意此处坐标从数组提取**********CGRect tappingArea=[[tapArea_Paigu objectAtIndex:i] CGRectValue];//CGRectIntersectsRect bool型函数 判断 tappingArea是否在touchArea内。。CGRectIntersectsRect(touchArea,tappingArea); - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject];...
阅读全文
摘要:txtfield点击出现pickerviewif (txtField.tag == 301) { [txtField resignFirstResponder]; UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self ...
阅读全文
摘要://// SensorAddDeleteViewController.m// Abviewer_iPhone//// Created by Ken.zhao on 13-11-20.// Copyright (c) 2013年 sven. All rights reserved.//#import "SensorAddDeleteViewController.h"#import "ABServices.h"#import "FormatWeekListViewController.h"@interface SensorAddDelet
阅读全文
摘要:if (IOS5) { [self presentViewController:navWeibo animated:YES completion:nil]; } else { [self presentModalViewController...
阅读全文
摘要://私有API,目前appstore可以审核通过了(iphone目前没问题,但是ipad会出现图片变形)CGImageRef img = UIGetScreenImage(); UIImage* scImage=[UIImage imageWithCGImage:img]; UIImageWriteToSavedPhotosAlbum(scImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); 下面这种截图,保存上下文(如果是yuv视频数据是无法直接保存,方法:视频数据时,可以采用yuv转...
阅读全文
摘要:- (void)showBaiduNetdiskFullAlarmView{ UITextField *textField = (UITextField *)objc_getAssociatedObject(self, &kNSStringBaiduNetdiskFullViewTag); if (textField != nil) { [m_imgViewTabbar addSubview:textField]; } else { UITextField *txtFieldBaidu = [[UITextField alloc]...
阅读全文
摘要://// Base64Tool.h// Abviewer_iPhone//// Created by sven on 13-4-16.// Copyright (c) 2013年 xxx. All rights reserved.//#import #define BASE64FromString( string ) [Base64Tool base64StringFromText:string]#define StringFromBASE64( base64 ) [Base64Tool textFromBase64String:base64]@interf...
阅读全文
摘要:CGGeometry类定义几何元素的结构和操作几何元素的函数。1、数据类型:CGFloat: 浮点值的基本类型CGPoint: 表示一个二维坐标系中的点CGSize: 表示一个矩形的宽度和高度CGRect: 表示一个矩形的位置和大小typedef float CGFloat;// 32-bittypedef double CGFloat;// 64-bitstruct CGPoint { CGFloat x; CGFloat y;};typedef struct CGPoint CGPoint;struct CGSize { CGFloat width; CGFloat...
阅读全文
摘要://获取indexPathNSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];//取消样式[cell setSelectionStyle:UITableViewCellSelectionStyleNone];//闪...
阅读全文