01 2015 档案
iOS学习之iOS沙盒(sandbox)机制和文件操作之NSFileManager
摘要:1、在Documents里创建目录创建一个叫test的目录,先找到Documents的目录,[cpp]view plaincopyNSArray*paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMas... 阅读全文
posted @ 2015-01-31 16:42 墓厄 阅读(161) 评论(0) 推荐(0)
NSSearchPathForDirectoriesInDomains用法(转)
摘要:1.iPhone会为每一个应用程序生成一个私有目录,这个目录位于:/Users/sundfsun2009/Library/Application Support/iPhone Simulator/User/Applications下,并随即生成一个数字字母串作为目录名,在每一次应用程序启动时,这个字... 阅读全文
posted @ 2015-01-31 09:48 墓厄 阅读(184) 评论(0) 推荐(0)
iOS沙盒(sandbox)机制及获取沙盒路径
摘要:一、每个iOS应用SDK都被限制在“沙盒”中,“沙盒”相当于一个加了仅主人可见权限的文件夹,苹果对沙盒有以下几条限制。 (1)、应用程序可以在自己的沙盒里运作,但是不能访问任何其他应用程序的沙盒。 (2)、应用程序间不能共享数据,沙盒里的文件不能被复制到其他应用程序文件夹中,也不能把其他应用程序... 阅读全文
posted @ 2015-01-31 09:43 墓厄 阅读(341) 评论(0) 推荐(0)
扫描IPHONE本地音乐文件,获得音乐名,歌手名代码示例
摘要://扫描本地音乐文件,返回艺术家列表 需要库MediaPlayer.framework -(NSArray*) findArtistList { NSMutableArray *artistList = [[NSMutableArray alloc]init]; MPMedia... 阅读全文
posted @ 2015-01-30 21:18 墓厄 阅读(398) 评论(0) 推荐(0)
ios获取音乐库信息(转)
摘要:1.访问音乐库的两种方法,如下图(只能访问音频文件,如music,podcast,audiobook等)2.MPMusicPlayerController的使用有两种播放器可以选择,一种是application music player,另外一种是iPod music player。第一种播放器是一... 阅读全文
posted @ 2015-01-30 21:05 墓厄 阅读(471) 评论(0) 推荐(0)
iOS 关闭应用程序
摘要://关闭应用程序- (void)exitApplication { [UIView beginAnimations:@"exitApplication" context:nil]; [UIView setAnimationDuration:0.5]; [UI... 阅读全文
posted @ 2015-01-29 14:22 墓厄 阅读(214) 评论(0) 推荐(0)
IOS 获取缓存目录文件大小并清除
摘要:1.获取缓存目录//获取缓存文件路径-(NSString *)getCachesPath{ // 获取Caches目录路径 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDoma... 阅读全文
posted @ 2015-01-29 14:21 墓厄 阅读(5902) 评论(0) 推荐(0)
ios 获得通讯录中联系人的所有属性
摘要:-(void)ReadAllPeoples{ //取得本地通信录名柄 ABAddressBookRef tmpAddressBook = nil; if ([[UIDevice currentDevice].systemVersion floatValue]... 阅读全文
posted @ 2015-01-14 21:27 墓厄 阅读(664) 评论(0) 推荐(0)
IOS中定时器NSTimer的开启与关闭
摘要:调用一次计时器方法:myTimer = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(scrollTimer) userInfo:nil repeats:NO]; //不重复,只调用一次。tim... 阅读全文
posted @ 2015-01-10 11:35 墓厄 阅读(159) 评论(0) 推荐(0)
tabBar中tabBarItem选中颜色自定义设置
摘要:1.在storyBoard中,选中tabBarController,设置tabBar如图2. 直接代码设置tabBarController.tabBar.selectedImageTintColor = [UIColor orangeColor];修改tabBarItem的字体颜色:[tabBarI... 阅读全文
posted @ 2015-01-07 17:35 墓厄 阅读(456) 评论(0) 推荐(0)