Fork me on GitHub
上一页 1 ··· 114 115 116 117 118 119 120 121 122 ··· 125 下一页

2012年2月7日

摘要: [[NSWorkspace sharedWorkspace] openURLs: urls withAppBundleIdentifier:@"com.apple.Safari" options: NSWorkspaceLaunchDefaultadditionalEventParamDescriptor: NULLlaunchIdentifiers: NULL]; 阅读全文
posted @ 2012-02-07 11:26 pengyingh 阅读(383) 评论(0) 推荐(0)
摘要: 制作 iPhone 电子书时,如果把大段文字放在 UITextView 或 UILabel 里显示,是不能分页的,阅读时就像再看一大卷滚不到头的纸带,用户体验很差。下面这段代码可以实现 UILabel 尺寸固定,根据文本内容和字体动态分页显示,电子书方面的应用应该非常有用。 1 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 2 - (void)viewDidLoad { 3 [super viewDidLoad]; 4 5 ... 阅读全文
posted @ 2012-02-07 11:25 pengyingh 阅读(745) 评论(0) 推荐(0)
摘要: 1 - (IBAction) record:(id)sender 2 { 3 4 NSError *error = nil; 5 BOOL b = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryRecord error:&error]; 6 [[AVAudioSession sharedInstance] setDelegate:self]; 7 if(b){ 8 NSLog(@"set audio session category record ... 阅读全文
posted @ 2012-02-07 11:16 pengyingh 阅读(327) 评论(0) 推荐(0)
摘要: 1 -setupApplicationAudio//声音文件及播放器的准备2 选择播放器3 - (void) updatePlayerQueueWithMediaCollection: (MPMediaItemCollection *) mediaItemCollection//更新播放器列表复制代码 1 - (void) setupApplicationAudio { 2 3 // Gets the file system path to the sound to play. 4 NSString *soundFilePath = [[NSB... 阅读全文
posted @ 2012-02-07 11:03 pengyingh 阅读(933) 评论(0) 推荐(0)
摘要: 示例名:MoviePlayer(电影播放器)功能:播放本地或网络视频框架:MediaPlayer.framework源码解释:1 -initAndPlayMovie创建一个电影播放控制器,指定播放内容的URL,并开始播放2 -applicationDidFinishLaunching从主程序束中得到Movie.m4v的路径,并调用-initAndPlayMovie开始播放核心源码: 1 -(void)initAndPlayMovie:(NSURL *)movieURL 2 { 3 // Initialize a movie player object with the spec... 阅读全文
posted @ 2012-02-07 10:27 pengyingh 阅读(2326) 评论(0) 推荐(0)
摘要: 项目名:SpeakHere功能:录制并播放用户录制的音频框架:AVFoundation.framework实现步骤:以下例子用到了AVAudioRecorder和AVAudioPlay来录制和播放音频,并且预先设置了一系列音频参数及保存路径。AVAudioRecorder和AVAudioPlay提供了相比openAL更为便捷的录音和播放方式,便于实现一些简单的录音和播放功能。1. 设置音频参数及保存路径 1 NSNumber *sampleRate, *formatId, *numberOfChannels, *audioQuality; 2 3 // recordin... 阅读全文
posted @ 2012-02-07 10:09 pengyingh 阅读(3855) 评论(0) 推荐(0)
摘要: Measuring Performance with the Built-in ProfilerUnity iOS provides your project with a built-in performance profiler. Note that it is disabled by default. In order to enable it you will have to open the Unity -generated XCode project, select theAppController.mmfile and change#define ENABLE_INTERNAL_ 阅读全文
posted @ 2012-02-07 08:55 pengyingh 阅读(541) 评论(0) 推荐(0)
摘要: Tuning Main Loop PerformanceSetting Up Desired Frame-RateUnity iOS allows you to tweak how many times per second your application will try to execute its rendering loop. By default it is 30 times per second. By lowering this number, your application will save more battery power but will render fewer 阅读全文
posted @ 2012-02-07 08:55 pengyingh 阅读(856) 评论(0) 推荐(0)
摘要: Optimizing Script PerformanceThis page gives some general hints for how to improve script performance on iOS.Reduce Fixed Delta TimeUse a fixed delta time of 15-25 fps. You can change this inEdit->Project Settings->Time. This reduces how oftenFixedUpdateis called and how often the physics engi 阅读全文
posted @ 2012-02-07 08:51 pengyingh 阅读(446) 评论(0) 推荐(0)
摘要: Optimizing Physics PerformanceUnity has the next-generation NVIDIA PhysX physics engine built-in. This allows for unique emergent behaviour. But you should not forget that iOS is an OS designed for mobile devices and has its own performance limits which can be very easily reached. The following are 阅读全文
posted @ 2012-02-07 08:49 pengyingh 阅读(253) 评论(0) 推荐(0)
上一页 1 ··· 114 115 116 117 118 119 120 121 122 ··· 125 下一页

导航