摘要: 1、常见的NSFileManager文件方法-(NSData *)contentsAtPath:path //从一个文件读取数据-(BOOL)createFileAtPath: path contents:(NSData *)data attributes:attr //向一个文件写入数据-(BOOL)removeItemAtPath:path error:err //删除一个文件-(BOOL)moveItemAtPath:from toPath:to error:err //重命名或者移动一个文件(to不能是已存在的)-(BOOL)copyItemAtPath:from toPath... 阅读全文
posted @ 2013-07-04 11:34 天牛 阅读(141) 评论(0) 推荐(0)
摘要: 一、在Documents、tmp和Library中存储文件Documents:用于存储应用程序中经常需要读取或写入的常规文件。tmp:用于存储应用程序运行时生成的文件。(随着应用程序的关闭失去了利用价值)Library:一般存放应用程序的配置文件,比如说plist类型的文件。二、读取和写入文件1、新建Empty Application应用程序,添加HomeViewController文件。HomeViewController.h代码:View Row Code1#import 23@interface HomeViewController : UIViewController 4{ 56} . 阅读全文
posted @ 2013-07-03 10:36 天牛 阅读(224) 评论(0) 推荐(0)
摘要: 1,在AppDelegate.h里定义一个idcurrentViewController;在AppDelegate.m里@implementationUIApplication (Private)- (BOOL)customOpenURL:(NSURL*)url{ beautyAppDelegate*MyWatcher = [[UIApplicationsharedApplication]delegate]; if(MyWatcher.currentViewController) { [MyWatcher.currentViewControllerhandleURL:url]; re... 阅读全文
posted @ 2013-06-27 20:00 天牛 阅读(322) 评论(0) 推荐(0)
摘要: 利用自带MPMoviePlayerController来实现视频播放,首先要在项目中导入MediaPlayer.Framework框架包。在视图控制器中#import"MediaPlayer/MPMoviePlayerController.h".m文件中,加入一下代码- (void)viewDidLoad{[superviewDidLoad];self.navigationController.navigationBar.hidden=YES;//geomancy.jpgUIImageView* nanshanImage=[[UIImageViewalloc]initWit 阅读全文
posted @ 2013-06-27 18:44 天牛 阅读(444) 评论(0) 推荐(0)
摘要: 动画效果提供了状态或页面转换时流畅的用户体验,在iOS系统中,咱们不需要自己编写绘制动画的代码,Core Animation提供了丰富的api来实现你需要的动画效果。 UIKit只用UIView来展示动画,动画支持UIView下面的这些属性改变:frameboundscentertransformalphabackgroundColorcontentStretch1、commitAnimations方式使用UIView动画- (void)viewDidLoad{ [super viewDidLoad]; UIButton *button = [UIButton butto... 阅读全文
posted @ 2013-06-27 14:18 天牛 阅读(290) 评论(0) 推荐(0)
摘要: 1.新建empty AppLication,添加HomeViewController页面, iphone.png图片2.在HomeViewController.xib中添加Image View,并调整其大小;再添加一个Slider控件3.HomeViewController.h代码:#import @interface HomeViewController : UIViewController{ CGPoint delta;//坐标变化量 NSTimer *timer; CGSize picSize;//图片大小 }@property (retain, nonatomic) IBOutle.. 阅读全文
posted @ 2013-06-27 14:15 天牛 阅读(434) 评论(0) 推荐(0)
摘要: 本文由论坛会员artgolff分享 前几天搜索资料时发现一个网站: iPhone Core Audio Development ,里面有iOS底层 音频 技术的几个源 代码 ,如果你要实现VoIP电话,实时语音分析,实时混音等功能本文由论坛会员artgolff分享前几天搜索资料时发现一个网站:iPhoneCoreAudio Development,里面有iOS底层音频技术的几个源代码,如果你要实现VoIP电话,实时语音分析,实时混音等功能可以参考。不幸的是这个技术网站由于不能说的原因不能访问:)需要翻,我把源代码附上,方便大家下载学习。这几个代码中只用到了声音播放部分代码,去掉了麦克风输入部分 阅读全文
posted @ 2013-06-27 09:50 天牛 阅读(516) 评论(0) 推荐(0)
摘要: 原文 http://hi.baidu.com/happywilma0118/item/e6d5730a499bba1b3a53eef8UISearchBar继承自UIView、UIResponder、NSObject属性:autocapitalizationType————自动对输入文本对象进行大小写设置(包含4种类型,但是有时候键盘会屏蔽此属性)autocorrectionType————自动对输入文本对象进行纠错。backgroundImage————searchbar的背景图片,如果图片不是可伸缩的或者1点宽,则一般被平铺barStyle————控件的样式delegate————控件的委 阅读全文
posted @ 2013-06-26 19:58 天牛 阅读(420) 评论(0) 推荐(0)
摘要: 1、UINavigationController导航控制器如何使用UINavigationController可以翻译为导航控制器,在IOS里经常用到。我们看看它的如何使用:下面的图显示了导航控制器的流程。最左侧是根视图,当用户点击其中的General项时 ,General视图会滑入屏幕;当用户继续点击Auto-Lock项时,Auto-Lock视图将滑入屏幕。相应地,在对象管理上,导航控制器使用了导 航堆栈。根视图控制器在堆栈最底层,接下来入栈的是General视图控制器和Auto-Lock视图控制器。可以调用 pushViewControllerAnimated:方法将视图控制器推入栈顶,也 阅读全文
posted @ 2013-06-25 20:04 天牛 阅读(540) 评论(0) 推荐(0)
摘要: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc... 阅读全文
posted @ 2013-06-24 11:01 天牛 阅读(213) 评论(0) 推荐(0)