集成百度地图的常见错误 (1)编译正常,运行报 [UIDevice uniqueGlobalDeviceIdentifier]: unrecognized selector sent to此时需要 other linker flags 添加 -all_load参数。 具体:Project ->build settings ->linking->Other Linker flag...
本地推送通知UILocalNotification 1 - (IBAction)schedule { 2 // 1.创建本地推送通知对象 3 UILocalNotification *ln = [[UILocalNotification alloc] init]; 4 5 // 2.设置通知属性 6 // 音效文件名 7 ln.soundName = @"bu...
ARC非ARC混合编程 1 将非arc转成arc edit➡️convert➡️to objective-c ARC ☑️ 如果不成功试以下方法 2 target中build phases下compile source中非arc的标记为 -fno-objc-arc(如果文件过多,这种方法太笨,不太适合) 3 到处静态库:选中要导出的文件夹 file➡️new➡️project➡️ios下framew...
ios键盘监听 1 // 监听键盘 2 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShowAction:) name:UIKeyboardWillShowNotification object:nil]; 3 4 ...
ios大文件下载之开始和暂停 1 #import "HMViewController.h" 2 3 @interface HMViewController () 4 @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 5 /** 6 * 写数据的文件句柄 7 */ 8 @prop...
ios大文件下载 1 #import "HMViewController.h" 2 3 @interface HMViewController () 4 @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 5 /** 6 * 写数据的文件句柄 7 */ 8 @prop...
ios解析json if (_helps == nil) { NSString *path = [[NSBundle mainBundle] pathForResource:@"help.json" ofType:nil]; NSData *data = [NSData dataWithContentsOfFile:path];...
ios网络NSURLConnection 1 #import "HMViewController.h" 2 #import "MBProgressHUD+MJ.h" 3 4 @interface HMViewController () <NSURLConnectionDataDelegate> 5 @property (weak, nonatomic) IBOutlet UIText...
ios核心动画之专场动画 1 #import "NJViewController.h" 2 3 @interface NJViewController () 4 @property (weak, nonatomic) IBOutlet UIImageView *iconView; 5 - (IBAction)nextBtnClick:(id)sender; 6 - (IBAction)...
ios网络NSURLConnection POST 1 #import "HMViewController.h" 2 #import "MBProgressHUD+MJ.h" 3 4 @interface HMViewController () 5 @property (weak, nonatomic) IBOutlet UITextField *usernameField; 6 @property (weak...
ios核心动画之关键帧动画 1 #import "NJViewController.h" 2 3 @interface NJViewController () 4 5 @property (weak, nonatomic) IBOutlet UIView *customView; 6 - (IBAction)btnClick:(id)sender; 7 @end 8 9 ...
ios UIView封装动画 1 #import "NJViewController.h" 2 3 @interface NJViewController () 4 @property (weak, nonatomic) IBOutlet UIView *cutomView; 5 6 @end 7 8 @implementation NJViewController 9 ...
ios自定义layer 两种方式 1 #import <QuartzCore/QuartzCore.h> 2 3 @interface NJLayer : CALayer 4 @end 5 6 7 #import "NJLayer.h" 8 9 @implementation NJLayer 10 11 // 重写该方法, 在该方法中给layer...
ios核心动画之组动画 1 // 平移动画 2 CABasicAnimation *a1 = [CABasicAnimation animation]; 3 a1.keyPath = @"transform.translation.y"; 4 a1.toValue = @(100); 5 // 缩放动画 6 CABasicAnimatio...
ios新建CALayer 1 // 如果一个控制是另外一个控件的子控件, 那么这个控件中的layer也是另外一个控件的子layer 2 NSLog(@"star - %@", self.view.layer.sublayers); 3 CALayer *layer = [CALayer layer]; 4 layer.backgroundColor = [UIColor...
ios核心动画之图片抖动 1 #import "NJViewController.h" 2 3 #define angle2Radian(angle) ((angle) / 180.0 * M_PI) 4 5 @interface NJViewController () 6 7 @property (weak, nonatomic) IBOutlet UIImageView *...
ios截屏 1 - (IBAction)captureView:(UIButton *)sender { 2 3 // 延迟1 ~2 秒之后再截屏 4 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue...
ios核心动画之基本动画 Core Animation,中文翻译为核心动画,它是一组非常强大的动画处理api,使用它能做出非常绚丽的动画效果,而且往往事半功倍。也就是说食用少量的代码就能实现非常强大的功能。 Core Animation可以用在Mac OS X和IOS平台 Core Animation的动画执行过程都是在后台操作的,不会阻塞主线程。 要注意的是,Core Animation是直接...
ios图片剪切之圆形头像 1 #import <UIKit/UIKit.h> 2 3 @interface UIImage (NJ) 4 /** 5 * 生成头像 6 * 7 * @param icon 头像图片名称 8 * @param border 头像边框大小 9 * @param color 头像边框的颜色 10 * 11 ...