2015年9月13日

pop动画

摘要: #import "ViewController.h"#import "POP.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; ... 阅读全文

posted @ 2015-09-13 20:50 Baymax01 阅读(876) 评论(0) 推荐(0) 编辑

CoreData的用法

摘要: #import "ViewController.h"#import "Student.h"@interface ViewController (){ NSArray *_dataArray; //负责应用与数据库交互 NSManagedObjectContext *_context... 阅读全文

posted @ 2015-09-13 20:45 Baymax01 阅读(174) 评论(0) 推荐(0) 编辑

高德地图详细使用方法

摘要: 1.简单定位 - (void)viewDidLoad { [super viewDidLoad]; _mapView.showsUserLocation = YES; [_mapView setUserTrackingMode:MAUserTrackingModeFollow]; } - (void 阅读全文

posted @ 2015-09-13 20:43 Baymax01 阅读(5155) 评论(0) 推荐(0) 编辑

GDataXML配置过程

摘要: GDataXML配置过程: (1).引入GDataXML(2个文件) .对GDataXML.m增加非arc注释 -fno-objc-arc(2).添加系统库 libxml2.dylib (3).Header Search Paths中添加 /usr/include/libxml2 阅读全文

posted @ 2015-09-13 20:31 Baymax01 阅读(138) 评论(0) 推荐(0) 编辑

图片懒加载(仿SDWebImage)

摘要: 1.图片缓存#import "UIImageView+WebCache.h"#import "ImageDownloader.h"@implementation UIImageView (WebCache)- (void)setImageWithUrl:(NSString *)urlStr andP... 阅读全文

posted @ 2015-09-13 20:27 Baymax01 阅读(305) 评论(0) 推荐(0) 编辑

GCD创建单例

摘要: //单例,+方法不能调用成员变量及属性 + (instancetype)sharedManager { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ if (!_manager) { _manager = [[ImageDownloaderManager all... 阅读全文

posted @ 2015-09-13 20:22 Baymax01 阅读(121) 评论(0) 推荐(0) 编辑

保存图片至相册

摘要: //创建图形上下文 UIGraphicsBeginImageContext(CGSizeMake(200, 200)); CGContextRef context = UIGraphicsGetCurrentContext(); UIImage *image = [UIIm... 阅读全文

posted @ 2015-09-13 20:20 Baymax01 阅读(349) 评论(0) 推荐(0) 编辑

创建pdf

摘要: //创建pdf图形上下文 NSString *path = [NSHomeDirectory() stringByAppendingString:@"/Documents/pdf.pdf"]; NSLog(@"%@",path); UIGraphicsBeginPDFContex... 阅读全文

posted @ 2015-09-13 20:19 Baymax01 阅读(156) 评论(0) 推荐(0) 编辑

IOS绘图

摘要: #import "MyView.h"@implementation MyView- (void)drawRect:(CGRect)rect { //获取图形上下文(drawrect方法中已经创建好图形上下文) CGContextRef context = UIGraphicsGetCur... 阅读全文

posted @ 2015-09-13 20:17 Baymax01 阅读(204) 评论(0) 推荐(0) 编辑

IOS断点续传

摘要: #import "ViewController.h"@interface ViewController (){ NSURL *_url; NSURLConnection *_connection; //文件读写 NSFileHandle *_fileHandle; //... 阅读全文

posted @ 2015-09-13 20:14 Baymax01 阅读(158) 评论(0) 推荐(0) 编辑

IOS程序之间的跳转

摘要: 1.首先在Info->URL Types 的 URL Schemes下写入本应用程序名,如:ProjectOne2.跳转到该程序(并传递参数)[[UIApplication sharedApplication]openURL:[NSURL URLWithString:[@"ProjectOne://... 阅读全文

posted @ 2015-09-13 20:12 Baymax01 阅读(150) 评论(0) 推荐(0) 编辑

MBProgressHUD的使用

摘要: 1.创建MBProgressHUD *_hud;2.显示//显示进度条-(void)createProgressView{ _numProgress = 0; _hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]... 阅读全文

posted @ 2015-09-13 19:39 Baymax01 阅读(131) 评论(0) 推荐(0) 编辑

清除缓存的方法(计算)

摘要: 1.计算- (float)checkTmpSize{ float totalSize = 0; NSDirectoryEnumerator *fileEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:diskCac... 阅读全文

posted @ 2015-09-13 19:28 Baymax01 阅读(255) 评论(0) 推荐(0) 编辑

使用post请求下载数据

摘要: //下载数据 -(void)requestData { NSURL *url = [NSURL URLWithString:kVerify]; //转码 //urlStr= [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSMutableURLRequest *reque... 阅读全文

posted @ 2015-09-13 19:17 Baymax01 阅读(387) 评论(0) 推荐(0) 编辑

NSTimer的使用

摘要: 1.创建NSTimer *_timer;2.使用_timer = [NSTimer scheduledTimerWithTimeInterval:0.5f target:self selector:@selector(nextTime) userInfo:nil repeats:YES]; [[NS... 阅读全文

posted @ 2015-09-13 19:15 Baymax01 阅读(114) 评论(0) 推荐(0) 编辑

定位功能(使用系统地图)

摘要: 1.导入MapKit,CoreLocation库 2.viewController文件 阅读全文

posted @ 2015-09-13 19:04 Baymax01 阅读(256) 评论(0) 推荐(0) 编辑

QQ简单登录

摘要: 1.下载QQ官方API文档,导入对应的包2.在Info->URL Types文件添加Identifier:tencent URL Schemes:tencent+应用appkey(去腾讯后台注册)3.Appdelegate文件#pragma mark --- QQLogin------ (BOOL)... 阅读全文

posted @ 2015-09-13 18:58 Baymax01 阅读(418) 评论(0) 推荐(0) 编辑

地图简单事例代码

摘要: 一:百度地图 1.按照API文档导入相应的库 2.AppDelegate文件 3.对应的viewController文件 二:高德地图 1.AppDelegate设置key值(高德后台注册) #import <MAMapKit/MAMapKit.h> [MAMapServices sharedSer 阅读全文

posted @ 2015-09-13 18:41 Baymax01 阅读(222) 评论(0) 推荐(0) 编辑

导航