- 博客(69)
- 收藏
- 关注
转载 集成百度地图的常见错误
(1)编译正常,运行报 [UIDevice uniqueGlobalDeviceIdentifier]: unrecognized selector sent to此时需要 other linker flags 添加 -all_load参数。 具体:Project ->build settings ->linking->Other Linker flag...
2016-02-08 19:45:00
208
转载 本地推送通知UILocalNotification
1 - (IBAction)schedule { 2 // 1.创建本地推送通知对象 3 UILocalNotification *ln = [[UILocalNotification alloc] init]; 4 5 // 2.设置通知属性 6 // 音效文件名 7 ln.soundName = @"bu...
2016-02-06 18:38:00
118
转载 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...
2016-02-06 16:53:00
105
转载 ios解析json
if (_helps == nil) { NSString *path = [[NSBundle mainBundle] pathForResource:@"help.json" ofType:nil]; NSData *data = [NSData dataWithContentsOfFile:path];...
2016-02-04 21:56:00
85
转载 ios键盘监听
1 // 监听键盘2 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShowAction:) name:UIKeyboardWillShowNotification object:nil];3 4 ...
2016-01-28 10:26:00
105
转载 ios倒计时刷新uibutton文字时闪动
需要同时写如下两行代码 self.resendBtn.titleLabel.text = str; [self.resendBtn setTitle:str forState:UIControlStateDisabled];转载于:https://www.cnblogs.com/PJHome/p/5164236.html...
2016-01-27 18:30:00
236
转载 hidesBottomBarWhenPushed导航栏右上角黑块问题解决
在AppDelegate中添加下面一句 self.window.backgroundColor = [UIColor whiteColor];转载于:https://www.cnblogs.com/PJHome/p/5163261.html
2016-01-27 14:53:00
116
转载 ios随机颜色
#ifdef __OBJC__ #import <UIKit/UIKit.h>#import <Foundation/Foundation.h>#import "UIView+Extension.h"// 颜色#define HMColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green...
2016-01-26 11:56:00
86
转载 ios大文件下载封装
1 #import <Foundation/Foundation.h> 2 3 @interface HMFileDownloader : NSObject 4 /** 5 * 所需要下载文件的远程URL(连接服务器的路径) 6 */ 7 @property (nonatomic, copy) NSString *url;...
2016-01-25 18:51:00
111
转载 ios大文件下载之开始和暂停
1 #import "HMViewController.h" 2 3 @interface HMViewController () 4 @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 5 /** 6 * 写数据的文件句柄 7 */ 8 @prop...
2016-01-25 18:47:00
140
转载 ios大文件下载
1 #import "HMViewController.h" 2 3 @interface HMViewController () 4 @property (weak, nonatomic) IBOutlet UIProgressView *progressView; 5 /** 6 * 写数据的文件句柄 7 */ 8 @prop...
2016-01-25 18:44:00
85
转载 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...
2016-01-25 16:45:00
116
转载 ios网络NSURLConnection
1 #import "HMViewController.h" 2 #import "MBProgressHUD+MJ.h" 3 4 @interface HMViewController () <NSURLConnectionDataDelegate> 5 @property (weak, nonatomic) IBOutlet UIText...
2016-01-25 16:42:00
127
转载 ios多线程GCD group
1 #import "HMViewController.h" 2 3 @interface HMViewController () 4 @property (weak, nonatomic) IBOutlet UIImageView *imageView1; 5 @property (weak, nonatomic) IBOutlet UIImageVi...
2016-01-25 15:46:00
89
转载 ios多线程GCD下载图片
1 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 2 { 3 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); 4 dispatch_async(...
2016-01-25 15:38:00
157
转载 ios多线程之GCD
1 @implementation HMViewController 2 3 - (void)viewDidLoad 4 { 5 [super viewDidLoad]; 6 7 [self performSelectorInBackground:@selector(test) withObject:nil]; ...
2016-01-25 15:24:00
82
转载 ios应用评分
为了提高应用的用户体验,经常需要邀请用户对应用进行评分应用评分无非就是跳转到AppStore展示自己的应用,然后由用户自己撰写评论如何跳转到AppStore,并且展示自己的应用方法1 NSString *appid = @"444934666"; NSString *str = [NSString stringWithFormat: ...
2016-01-25 14:30:00
117
转载 ios应用间跳转
有时候,需要在本应用中打开其他应用,比如从A应用中跳转到B应用首先,B应用得有自己的URL地址(在Info.plist中配置)B应用的URL地址就是:mj://ios.itcast.cn 接着在A应用中使用UIApplication完成跳转 NSURL *url = [NSURL URLWithString:@"mj://ios.itcast.cn...
2016-01-25 14:28:00
60
转载 ios打开其它常见文件
如果想打开一些常见文件,比如html、txt、PDF、PPT等,都可以使用UIWebView打开只需要告诉UIWebView文件的URL即可至于打开一个远程的共享资源,比如http协议的,也可以调用系统自带的Safari浏览器:NSURL *url = [NSURL URLWithString:@”http://www.baidu.com"];[[UIApplic...
2016-01-25 14:17:00
90
转载 ios发邮件
1 用自带的邮件客户端,发完邮件后不会自动回到原应用 2 NSURL *url = [NSURL URLWithString:@"mailto://10010@qq.com"]; 3 [[UIApplication sharedApplication] openURL:url]; 1 跟发短信的第2种方法差不多,只不过控制器类名叫做:MFMailComposeViewC...
2016-01-25 14:16:00
76
转载 ios发短信
1 直接跳到发短信界面,但是不能指定短信内容,而且不能自动回到原应用 2 NSURL *url = [NSURL URLWithString:@"sms://10010"]; 3 [[UIApplication sharedApplication] openURL:url]; 1 如果想指定短信内容,那就得使用MessageUI框架 2 包含主头文件 3 #im...
2016-01-25 14:12:00
110
转载 ios打电话
1 最简单最直接的方式:直接跳到拨号界面2 NSURL *url = [NSURL URLWithString:@"tel://10010"];3 [[UIApplication sharedApplication] openURL:url];4 缺点5 电话打完后,不会自动回到原应用,直接停留在通话记录界面1 拨号之前会弹框询问用户是否拨号,拨完后...
2016-01-25 14:08:00
88
转载 ios UICollectionView使用
1 #import <UIKit/UIKit.h> 2 3 @interface NJProductViewController : UICollectionViewController 4 // 'UICollectionView must be initialized with a non-nil layout parameter' 5...
2016-01-24 22:53:00
92
转载 ios UICollectionView基本使用
#import <UIKit/UIKit.h>@interface NJProductViewController : UICollectionViewController// 'UICollectionView must be initialized with a non-nil layout parameter'// 创建UIC...
2016-01-24 22:29:00
127
转载 ios Class类型使用
1 #import <Foundation/Foundation.h> 2 3 @interface NJProductItem : NSObject 4 /** 5 * 图标 6 */ 7 @property (nonatomic, copy) NSString *icon; 8 /** 9 * 标题10 */11...
2016-01-24 19:03:00
177
转载 ios自定义UINavigationController
1 #import <UIKit/UIKit.h> 2 3 @interface NJNavigationController : UINavigationController 4 5 @end 6 7 8 9 #import "NJNavigationController.h"10 11 @interface NJNa...
2016-01-24 18:12:00
105
转载 ios彩票标题按钮(左文字右图片)
1 #import <UIKit/UIKit.h> 2 3 @interface NJTitleButton : UIButton 4 5 @end 6 7 8 #import "NJTitleButton.h" 9 10 @interface NJTitleButton ()11 @property (nonatomic...
2016-01-24 17:52:00
99
转载 ios导航条设置
1 // 3.设置导航条的主题 2 // 如果要同时设置很多UINavigationBar的样式, 可以通过设置UINavigationBar的主题的方式来设置以便简化代码 3 UINavigationBar *navBar = [UINavigationBar appearance]; 4 // 3.1设置所有导航条的背景图片 5 ...
2016-01-24 15:12:00
98
转载 ios彩票之zidingyitabbar
1 #import <UIKit/UIKit.h> 2 3 @protocol NJTabBarDelegate <NSObject> 4 /** 5 * @param from 从哪个视图(视图索引) 6 * @param to 到哪个视图(视图索引) 7 */ 8 - (void)tabBarDidSelect...
2016-01-24 14:34:00
65
转载 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 ...
2016-01-24 11:59:00
99
转载 ios核心动画之组动画
1 // 平移动画 2 CABasicAnimation *a1 = [CABasicAnimation animation]; 3 a1.keyPath = @"transform.translation.y"; 4 a1.toValue = @(100); 5 // 缩放动画 6 CABasicAnimatio...
2016-01-24 11:54:00
84
转载 ios核心动画之专场动画
1 #import "NJViewController.h" 2 3 @interface NJViewController () 4 @property (weak, nonatomic) IBOutlet UIImageView *iconView; 5 - (IBAction)nextBtnClick:(id)sender; 6 - (IBAction)...
2016-01-24 11:53:00
101
转载 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 *...
2016-01-24 11:31:00
103
转载 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 ...
2016-01-24 11:30:00
92
转载 ios核心动画之基本动画
Core Animation,中文翻译为核心动画,它是一组非常强大的动画处理api,使用它能做出非常绚丽的动画效果,而且往往事半功倍。也就是说食用少量的代码就能实现非常强大的功能。Core Animation可以用在Mac OS X和IOS平台Core Animation的动画执行过程都是在后台操作的,不会阻塞主线程。要注意的是,Core Animation是直接...
2016-01-24 11:26:00
115
转载 ios自定义layer
两种方式 1 #import <QuartzCore/QuartzCore.h> 2 3 @interface NJLayer : CALayer 4 @end 5 6 7 #import "NJLayer.h" 8 9 @implementation NJLayer10 11 // 重写该方法, 在该方法中给layer...
2016-01-24 10:27:00
81
转载 ios隐式动画
1. 每一个UIView内部都默认关联着一个CALayer,我们可以称这个Layer为Root Layer2. 所有的非Root Layer,也就是手动创建的CALayer对象都存在着隐式动画什么是隐式动画 1 当对非Root Layer的部分属性进行修改时,默认会自动产生一些动画效果 2 而这些属性称为Animatable Properties(可动画属性)...
2016-01-24 10:13:00
128
转载 ios新建CALayer
1 // 如果一个控制是另外一个控件的子控件, 那么这个控件中的layer也是另外一个控件的子layer2 NSLog(@"star - %@", self.view.layer.sublayers);3 CALayer *layer = [CALayer layer];4 layer.backgroundColor = [UIColor...
2016-01-24 00:04:00
78
转载 ios CALayer之图片剪切2
1 /**/ 2 // 设置layer边框 3 self.customView.layer.borderWidth = 10; 4 // 设置layer边框颜色 5 self.customView.layer.borderColor =[UIColor blackColor].CGColor; 6 // 设置lay...
2016-01-23 23:57:00
111
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人