自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 收藏
  • 关注

翻译 Storing Videos in the Photo Library(储存视频至手机)

1。framework:#import    方法:writeVideoAtPathToSavedPhotosAlbume.g.   ALAssetsLibrary *assetsLibrary = [[ALAssetsLibrary alloc] init];        NSURL *videoURL = [[NSBundle mainBundle]  URLForR

2014-01-29 11:52:43 791

翻译 Storing Photos in the Photo Library(储存相片至手机)

1。库(frame)和协议(protocol)   #import        方法:UIImageWriteToSavePhotosAlbume.g.- (BOOL) cameraSupportsMedia:(NSString *)paramMediaType  sourceType:(UIImagePickerControllerSourceType)pa

2014-01-28 16:05:38 813

翻译 Taking Videos with the Camera(摄像)

1。导入库,实现协议   #import    e.g.- (BOOL) cameraSupportsMedia:(NSString *)paramMediaType sourceType:(UIImagePickerControllerSourceType)paramSourceType{    __block BOOL result = NO;

2014-01-28 14:00:45 1215

翻译 Taking Photos with the Camera(拍照)

1。导入库,实现协议   #import    e.g.- (BOOL) cameraSupportsMedia:(NSString *)paramMediaType sourceType:(UIImagePickerControllerSourceType)paramSourceType{    __block BOOL result = NO;

2014-01-27 17:03:49 948

翻译 Detecting and Probing the Camera(检测,探测相机)

1。导入的库和使用的类  #import    #import   UIImagePickerControllerClass2。资源类型可用性:    isSourceTypeAvailable   BOOL isCameraOK = [UIImagePickerController                       isSourceTypeA

2014-01-27 14:45:22 1056

翻译 save Objects to Files

1。将对象保存到磁盘文件中:该对象必须实现协议   - (void)encodeWithCoder:(NSCoder *)aCoder;   - (instancetype)initWithCoder:(NSCoder *)aDecoder;   NSKeyedArchiver:归档、存档,将对象读入(保存到磁盘文件中)   NSKeyedUnarchiver:解档,将对象取出

2014-01-26 16:40:52 944

翻译 delete Files and Folders(删除文件、文件夹)

1。实现方法:- (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)errore.g.@property (nonatomic, strong) NSFileManager *fileManager;/* 根据给定的路径创建文件夹 */- (void) createFolder:(NSString *)p

2014-01-26 15:17:47 1862

翻译 enumerate Files and Folders(遍历)

1。对指定目录的浅遍历   - (NSArray *)contentsOfDirectoryAtPath:(NSString *)path error:(NSError **)error e.g.- (void) actionEnumerate{     NSFileManager *fileManager = [[NSFileManager alloc] init];

2014-01-26 11:23:51 1778

翻译 Creat folders -创建文件夹

1。实现  - (BOOL)createDirectoryAtPath:(NSString *)pathwithIntermediateDirectories:(BOOL)createIntermediates attributes:(NSDictionary *)attributes error:(NSError **)errorcreateIntermediates:YES-若

2014-01-24 17:04:03 995

翻译 write to and read from files (读写文件)

1。路径 :   NSString *filePath = [NSTemporaryDirectory()  stringByAppendingPathComponent:@"MyFile.txt"];2。写入文件:NSString : //带编码    - (BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAux

2014-01-24 15:45:55 1003

翻译 IOS文件系统-获取相应文件夹

1。实现:NSFileManager   - (NSArray *)URLsForDirectory:(NSSearchPathDirectory)directory inDomains:(NSSearchPathDomainMask)domainMask   URLsForDirectory: NSLibraryDirectory(app应用的库文件夹) / NSCachesDirect

2014-01-24 11:31:23 1048

翻译 IOS文件系统的简单描述

1。当ios app安装到设备后,文件结构显示如下Your.app : 是个文件夹,内容包括所有的资源,如app icons,sounds,etc.Documents/ : 所有用户创建的内容Library/ : 存储缓存文件,用户偏好等  Library/Caches/ :不会被系统备份,当app运行的磁盘空间不够或app运行暂停时,该文件夹中存储的缓存内容有可能被删除,

2014-01-23 17:18:18 656

翻译 Capture Thumbnails from Video Files (捕获视频中的屏幕截图)

1。使用MPMoviePlayerController在当前播放的视频中异步获取屏幕截图e.g.@property(nonatomic,strong)UIImage *captureImg; //保留抓捕的图像//播放视频- (void) startPlayingVideo:(id)paramSender{    NSBundle *mainBundle = [NSBund

2014-01-23 11:37:58 1913

翻译 Play video Files(播放视频)

1。实现:   导入: #import    MPMoviePlayerController:可进行更加全面的视频显示设置   MPMoviePlayerViewController:可以放入navigationController,简单实现全屏显示,                               或是用presentMoviePlayerViewController

2014-01-22 17:05:27 4477

翻译 Play Audio over Other Active Sounds

1。AVAudioSession:每一个ios应用都有一个audio session    AVAudioSession *audioSession = [AVAudioSessionsharedInstance];2。设置类别:    - (BOOL)setCategory:(NSString *)theCategory error:(NSError **)outError

2014-01-22 11:45:42 833

翻译 Record Audio(录音)

1。导入 #import  2。实现协议e.g.@property (nonatomic, strong)AVAudioRecorder *audioRecorder;@property (nonatomic, strong) AVAudioPlayer *audioPlayer;//录音后保存的音频文件的路径- (NSURL *) audi

2014-01-21 17:51:01 3362

翻译 Play audio Files (播放音频文件)

1。必须导入    AV Foundation framework : #import  2。实现协议: e.g.@property (nonatomic, strong)AVAudioPlayer *audioPlayer;- (void)actionPlay {    //为后续异步加载,使用并行全局队列    dispatch_queu

2014-01-21 15:49:52 1270

翻译 Gesture-Pinch(捏)

1。Pinch works in two ways:scaling up / scaling down ,连续的手势@property (nonatomic, strong) UILabel *lbl;@property  CGFloat currentScale; //比例- (void) handlePinches:(UIPinchGestureRecognizer*)pa

2014-01-21 11:17:29 784

翻译 Gesture - Tap单击

1。A tap gesture :discrete gesture (不连续手势)- (void)addGesture {   UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]  initWithTarget:self action:@selector(handleTaps:)];    

2014-01-21 10:39:42 635

翻译 Gesture - Long Press

@property (nonatomic, strong) UIButton *dummyButton;@property (nonatomic, strong) UILongPressGestureRecognizer *longPressGesture;-(void)initButton {    self.btn = [UIButton buttonWithT

2014-01-21 10:23:28 754

翻译 Gesture - Pan,Drag 拖移

@property (nonatomic, strong) UILabel *lbl;-(void)initLabel {    CGRect labelFrame = CGRectMake(0.0f,   0.0f,  150.0f,  100.0f);       self.lbl = [[UILabel alloc] initWithFrame:labelFram

2014-01-20 17:40:30 1210

翻译 Gesture - Rotation旋转

1。@property (nonatomic, strong) UILabel *lbl;@property CGFloat rotationAngleInRadians; //旋转的角度- (void) handleRotations:(UIRotationGestureRecognizer *)paramSender{    if (self.lbl == nil)

2014-01-20 16:34:41 637

翻译 Gesture - Swipe滑动

1。-(void)addGesture {    UISwipeGestureRecognizer swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self  action:@selector(handleSwipes:)];        /* 可被侦测到的滑动方向 */    swi

2014-01-20 10:21:06 1199

翻译 NSTimer的简单使用

1。NSTimer:在将来的某一时刻开始一次性执行或是周期性执行指定的方法方法:+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds target:(id)target selector:(SEL)aSelector              userInfo:(id)userInfo repeats:(

2014-01-16 16:58:35 591

翻译 GCD使用(六)串行队列的构造

1。串行队列:      FIFO方式,并发时的异步操作不会在主线程进行    dispatch_queue_create(CStringID , 0): CStringID形式-com.COMPANY.PRODUCT.ID,不需要加@e.g.    //串行队列,非mainQueue,非globalQueue    dispatch_queue_t firstSerialQu

2014-01-15 17:53:11 618

翻译 GCD使用(五)分组操作(group)

1。监听一组任务是否完成,完成后得到通知,执行其他的操作     dispatch_group_create :创建     dispatch_group_async  /  dispatch_group_async_f :分组操作 (组里的任务是一个接一个的操作)     dispatch_group_notify (group , queue ,  block) :在组里的操作都结

2014-01-15 16:56:49 1115

翻译 GCD使用(四)操作只执行一次

1。dispatch_once ( &dispatch_once_t , block )e.g.static dispatch_once_t onceToken;void (^executedOnlyOnce)(void) = ^{      static NSUInteger numberOfEntries = 0;    numberOfEntries++;

2014-01-14 14:52:25 677

翻译 GCD使用(三)执行延时操作

1。自带的延时(非GCD)  - (void) printString:(NSString *)paramString{    NSLog(@"%@", paramString);}-(void)actionDelay {    [self performSelector:@selector(printString:) withObject:@"Grand Centra

2014-01-14 11:10:07 703

翻译 GCD使用(二)执行与UI无关的操作

1。并发队列:dispatch_get_global_queue       dispatch_queue_t  concurrentQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);      参数:优先等级DISPATCH_QUEUE_PRIORITY_LOW , DISPATCH_QUEUE_P

2014-01-14 10:29:38 599

翻译 GCD使用(一)执行与UI有关的操作

1。使用GCD时,与UI有关的操作只能放在主线程中进行           dispatch_get_main_queue,           dispatch_async ( dispatch_queue_t queue, dispatch_block_t block)  异步执行,参数:操作队列,执行块           dispatch_async_f ( dispatch_

2014-01-09 11:00:22 561

翻译 Block的使用(二)变量

1。 变量访问:外部变量,在block内是只读                           在外部声明变量时加上前缀__block,在block内成可读写2。属性访问:在方法内部的内联(匿名)block中出现的self表示该 方法所属的类本身,可通过.property对该类的属性进行读取,设置                          对于独立的block(即单独声明定

2014-01-09 09:55:52 545

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除