Fork me on GitHub

2012年2月7日

摘要: 用UIImagePickerController选择、显示图片或视频,主要注意UIImagePickerController几个属性的设置一:UI 显示样式,显示的格式确定1:sourceType@property(nonatomic) UIImagePickerControllerSourceType sourceTypeenum {UIImagePickerControllerSourceTypePhotoLibrary,UIImagePickerControllerSourceTypeCamera,UIImagePickerControllerSourceTypeSavedPhotosA 阅读全文
posted @ 2012-02-07 22:53 pengyingh 阅读(9940) 评论(0) 推荐(0)
摘要: UITextInputTraits属性autocapitalizationType 设置键盘自动大小写的属性 UITextAutocapitalizationTypeNoneautocorrectionType property 设置是否有自动修改提示 UITextAutocorrectionTypeNoenablesReturnKeyAutomatically Boolean值-设置在用户没有输入是returnKey禁用,默认值NOkeyboardAppearance 设置键盘显示方式 除了默认模式 还有一个UIKeyboardAppearanceAlert模式keyboardType 设置 阅读全文
posted @ 2012-02-07 22:40 pengyingh 阅读(282) 评论(0) 推荐(0)
摘要: -译自 weimenglee 的Programming ApplePush Notification ServicesiPhone 对于应用程序在后台运行有诸多限制(除非你越狱)。因此,当用户切换到其他程序后,原先的程序无法保持运行状态。对于那些需要保持持续连接状态的应用程序(比如社区网络应用),将不能收到实时的信息。为解决这一限制,苹果推出了APNs(苹果推送通知服务)。APNs 允许设备与苹果的推送通知服务器保持常连接状态。当你想发送一个推送通知给某个用户的iPhone上的应用程序时,你可以使用 APNs 发送一个推送消息给目标设备上已安装的某个应用程序。本文中,你将学到创建使用 APNs 阅读全文
posted @ 2012-02-07 22:37 pengyingh 阅读(8593) 评论(0) 推荐(1)
摘要: 很多时候,我们不需要关心这个类,我们很少继承这个类,偶尔会调用这个类的api来实现一些功能,但是不可否认,这个类是iOS编程中很重要的一个概念,所以我这里写这个文章来总结以下这个类的信息,如果写的不对的地方,请留言,多谢。UIApplication的核心作用是提供了iOS程序运行期间的控制和协作工作。每一个程序在运行期必须有且仅有一个UIApplication(或则其子类)的一个实例。回想一下我在前面的文章“main函数研究”的文章中提到的main函数的代码,可以看出,在程序开始运行的时候,UIApplicationMain函数是程序进入点,这个函数做了很多工作,其中一个重要的工作就是创建一个 阅读全文
posted @ 2012-02-07 22:30 pengyingh 阅读(14374) 评论(1) 推荐(2)
摘要: 最近一直在忙着做数据库,不少同事问到数据库的问题,现在跟大家分享一下!接着上次讲的知识点,还记得怎样把图片转换成NSData类型的格式吗??很简单吧,在UIKit框架里有这个方法NSData * UIImageJPEGRepresentation ( UIImage *image, CGFloat compressionQuality);和NSData * UIImagePNGRepresentation ( UIImage *image);写 到这里大家可能已经明白怎样将图片导进数据库了吧!!数据库中存放图片声音等都是BLOB类型的,什么是BLOB类型呢?这个暂时先不在这里讲解了... 阅读全文
posted @ 2012-02-07 22:26 pengyingh 阅读(731) 评论(0) 推荐(0)
摘要: //saving an image 1 - (void)saveImage:(UIImage*)image:(NSString*)imageName { 2 3 NSData *imageData = UIImagePNGRepresentation(image); //convert image into .png format. 4 5 NSFileManager *fileManager = [NSFileManager defaultManager];//create instance of NSFileManager 6 7 NSArray *paths = NSSearchP... 阅读全文
posted @ 2012-02-07 22:15 pengyingh 阅读(212) 评论(0) 推荐(0)
摘要: iPhone开发小技巧集合1。给iPhone程序创建Splash欢迎界面最简单的方法就是做一个全屏的欢迎页的图片,把它命名为Default.png,然后放在Xcode工程的Resource里面。 执行就可以看到你的这个默认图像在程序完全加载之前显示在屏幕上。Default.png是一张480*320的png图片用于在程序启动时显示。启动时,系统会用这张图片作为临时背景,直到程序载入了他的窗口和用户界面。Icon.png是一张57*57的png图片,用于在iPhone的主界面上作为程序图标代表你的程序。这张图片不需要有其他附加特效,系统会自动添加这些效果。Icon-Setting.png是一张2 阅读全文
posted @ 2012-02-07 22:11 pengyingh 阅读(214) 评论(0) 推荐(0)
摘要: UIToolBar 三种办法方法一/toolBarbackgroundimagesetbasedoniOSversion[[UIDevicecurrentDevice]systemVersion];if([[[UIDevicecurrentDevice]systemVersion]floatValue]>4.9){//iOS5UIImage*toolBarIMG=[UIImageimageNamed:@"toolBar_brown.png"];if([toolBarrespondsToSelector:@selector(setBackgroundImage:forT 阅读全文
posted @ 2012-02-07 22:08 pengyingh 阅读(2884) 评论(0) 推荐(0)
摘要: 使用下面函数创建一个pdfCGPDFDocumentRef CGPDFDocumentCreateWithProvider ( CGDataProviderRef provider );复制代码创建provider使用下面函数CGDataProviderRef CGDataProviderCreateWithCFData ( CFDataRef data );复制代码CGContextRef context = UIGraphicsGetCurrentContext();画一个正方形图形 没有边框CGContextSetRGBFillColor(context, 0, 0.25, 0, 0.5 阅读全文
posted @ 2012-02-07 22:06 pengyingh 阅读(3465) 评论(0) 推荐(0)
摘要: iphone中主要通过下面的几个技术来绘图OpenGL, Quartz, UIKit, or Core AnimationUIKit 是非线程安全的,所以最好把所有的绘图都放在主线程上执行不管使用的哪个技术来绘图,所有的绘图都是在 UIView object 中进行, view决定绘图在那里进行绘画周期当一个view需要更新某一部分内容的时候,view会请求 drawRect: 方法在view第一次请求drawRect方法的时候,传递的rectangle 参数一般是view的整个rectangle ,后续更新的时候,传递的一般是需要更新的那部分rectangle在几种情况下,view会重新绘图 阅读全文
posted @ 2012-02-07 22:04 pengyingh 阅读(200) 评论(0) 推荐(0)
摘要: 密码输入错误一定次数断开连接1 /*--------------------------------------------------------------------------- 2 * Received a server challenge:AuthenticationChallenge 3 *--------------------------------------------------------------------------*/ 4 - (void)connection:(NSURLConnection *)connection didReceiveAut... 阅读全文
posted @ 2012-02-07 21:50 pengyingh 阅读(266) 评论(0) 推荐(0)
摘要: 程序名:oalTouch (OpenAL的一个应用)功能:通过AVAudioPlayer播放背景音乐,通过OpenAL播放自定音乐,其中自定音乐可播放、暂停,当两个音乐同时播放时可实现混音效果。(我去掉了重力检测和AudioSession两个非主要功能)实现步骤:直接调用AVAudioPlayer播放音乐较为简单:通过AVAudioPlay的init方法设定音乐文件的路径通过其play方法播放背景音乐复制代码使用openAL播放音乐实现步骤较为烦琐,此处由于用OpenAL播放的只有一个音乐,去掉了创建Session的内容。得到设备device创建一块设备的音频存储空间context把音频数据d 阅读全文
posted @ 2012-02-07 21:40 pengyingh 阅读(901) 评论(0) 推荐(0)
摘要: MetronomeMetronome是节拍器的意思,用在艺术创作中,例如声乐中打节拍.节拍器中间有个小竖棍,上面有个滑块,上下拨动滑块,就可以调节节拍的快拍.app有一个配置页面,用来设置2/4,3/4,4/4拍.配置设置好后,调用1 if (newIndexPath.row == 0) {2 [appDelegate setTimeSignature:TimeSignatureTwoFour];3 }4 else if (newIndexPath.row == 1) {5 [appDelegate setTimeSignature:Ti... 阅读全文
posted @ 2012-02-07 21:31 pengyingh 阅读(782) 评论(0) 推荐(0)
摘要: 示例名:SysSound (声音播放器)功能:播放系统声音(声音文件)、警告声(声音文件+振动)、振动FrameWork: AudioToolbox.framework源码解释:得到主程序束路径得到声音文件:tap.aif路径创建系统声音ID(以路径为参数,返回声音对象)根据需要播放:系统声音、警告声、振动核心代码: 1 - (void)viewDidLoad { 2 CFURLRef soundFileURLRef; // the URL for tap.aif 3 SystemSoundID soundFileObject; // the object ... 阅读全文
posted @ 2012-02-07 21:20 pengyingh 阅读(389) 评论(0) 推荐(0)
摘要: 1 头文件 2 3 #import <Foundation/Foundation.h> 4 5 @interface NSData (AESTest) 6 -(NSData*)AES256EncryptWithKey:(NSString*)key; 7 -(NSData*)AES256DecryptWithKey:(NSString*)key; 8 9 @end 10 11 实现文件 12 13 #import <CommonCrypto/CommonCryptor.h> 14 #import "NSData.h" 15 16 17 @impleme 阅读全文
posted @ 2012-02-07 20:45 pengyingh 阅读(864) 评论(0) 推荐(1)
摘要: 1.绘图总结:绘图前设置:CGContextSetRGBFillColor/CGContextSetFillColorWithColor //填充色CGContextSetRGBStrokeColor/CGContextSetStrokeColorWithColor //笔颜色CGContextSetLineWidth //线宽度绘图后设置:注: 画完图后,必须先用CGContextStrokePath来描线,即形状后用CGContextFillPath来填充形状内的颜色.2.常见图形绘制:CGContextFillRect/CGContextFillRectsCGContextFillEll 阅读全文
posted @ 2012-02-07 20:42 pengyingh 阅读(556) 评论(0) 推荐(0)
摘要: 1、如果在程序中想对某张图片进行处理的话(得到某张图片的一部分)可一用以下代码:UIImage *image = [UIImageimageNamed:filename];CGImageRef imageRef = image.CGImage;CGRect rect =CGRectMake(origin.x, origin.y,size.width, size.height);CGImageRef imageRefRect =CGImageCreateWithImageInRect(imageRef, rect);UIImage *imageRect = [[UIImagealloc]init 阅读全文
posted @ 2012-02-07 20:36 pengyingh 阅读(599) 评论(0) 推荐(0)
摘要: iPhone开发 - 常用库 这里总结了iPhone开发者开发过程中可能需要的一些资源如何用Facebook graphic api上传视频:http://developers.facebook.com/blog/post/532/Keychain保存数据封装:https://github.com/carlbrown/PDKeychainBindingsController对焦功能的实现:http://www.clingmarks.com/?p=612自定义圆角Switch按件:https://github.com/domesticcatsoftware/DCRoundSwitch弹出窗口Fo 阅读全文
posted @ 2012-02-07 20:34 pengyingh 阅读(847) 评论(0) 推荐(2)
摘要: 磨刀不误砍柴工。作为手机应用开发者,你需要向应用商店提交应用审核,迅速通过审核可以让你抢占先机。对苹果iOS应用开发者来说尤其如此。苹果应用商店的审核近乎吹毛求疵,下面这些清单可以让你知道苹果会在哪些地方找茬。基本要点首先,你的应用程序:- 不能导致手机故障(比如崩溃或屏幕问题)- 长时间/过度使用之后反应仍然很快- 应用内的所有价格信息中不能用固定值代替可变变量- 不要使用任何SDK里面的私人API- 不要使用任何SDK文档里面没有列出的功能- 不要提及用户设备上不存在的硬件功能- 如果需要网络连接,在没有网络的情况下要告知用户- 不要(过度)模仿任何本地应用程序- 不要(过度)山寨某个本地 阅读全文
posted @ 2012-02-07 20:30 pengyingh 阅读(173) 评论(0) 推荐(0)
摘要: 加密:1 NSString* encodeURL(NSString *string)2 {3 NSString *newString = NSMakeCollectable([(NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)string, NULL, CFSTR(":/?#[]@!$ &'()*+,;="<>%{}|\\^~`"), CFStringConvertNSStringEncodingToEncoding 阅读全文
posted @ 2012-02-07 20:20 pengyingh 阅读(309) 评论(0) 推荐(0)
摘要: 更改cell选中的背景 UIView *myview = [UIView alloc] init]; myview.frame = CGRectMake(0, 0, 320, 47); myview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"0006.png"]; cell.selectedBackgroundView = myview;在数字键盘上添加button://定义一个消息中心[NSNotificationCenter defaultCenter] addObs.. 阅读全文
posted @ 2012-02-07 20:12 pengyingh 阅读(157) 评论(0) 推荐(0)
摘要: NSNumber+ (NSNumber *)numberWithInt:(int)value;+ (NSNumber *)numberWithDouble:(double)value;- (int)intValue;- (double)doubleValue;NSNumber可以将基本数据类型包装起来,形成一个对象,这样就可以给其发送消息,装入NSArray中等等。NSNumber * intNumber=[NSNumbernumberWithInt:100];NSNumber *floatNumber=[NSNUmbernumberWithFloat:100.00];int i=[intNu 阅读全文
posted @ 2012-02-07 20:03 pengyingh 阅读(1800) 评论(0) 推荐(0)
摘要: 1. NSString转化为UNICODE String:(NSString*)fname = @“Test”;char fnameStr[10];memcpy(fnameStr, [fname cStringUsingEncoding:NSUnicodeStringEncoding], 2*([fname length]));与strcpy相比,memcpy并不是遇到'\0'就结束,而是一定会拷贝完n个字节2. NSString 转化为 char *NSString * str= @“Test”;const char * a =[str UTF8String];3.char 阅读全文
posted @ 2012-02-07 20:01 pengyingh 阅读(101876) 评论(0) 推荐(0)
摘要: iPhone文件系统:创建、重命名以及删除文件NSFileManager中包含了用来查询单词库目录、创建、重命名、删除目录以及获取/设置文件属性的方法(可读性,可编写性等等)。每个程序都会有它自己的沙盒,通过它你可以阅读/编写文件。写入沙盒的文件在程序的进程中将会保持稳定,即便实在程序更新的情况下。如下所示,你可以在沙盒中定位文件目录://对于错误信息NSError *error;// 创建文件管理器NSFileManager *fileMgr = [NSFileManagerdefaultManager];//指向文件目录NSString *documentsDirectory= [NSHo 阅读全文
posted @ 2012-02-07 18:52 pengyingh 阅读(1795) 评论(0) 推荐(0)
摘要: 1 TodoViewController *contentViewController = [[TodoViewController alloc] init]; 2 3 UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:contentViewController]; 4 5 navigationController.contentSizeForViewInPopover = CGSizeMake(100, 100); //内容大... 阅读全文
posted @ 2012-02-07 17:51 pengyingh 阅读(164) 评论(0) 推荐(0)
摘要: 在 iPhone 应用或者是游戏的开发过程中,对声音的支持是必不可少的。在我做过的几个应用中,每个都涉及到音效,所以在这里做个简单的归纳,很多都是引用自《iPhone Application Programming Guide》(需要有 Apple ID 才能打开链接),加了一些实际使用的经验。iPhone OS 主要提供以下了几种播放音频的方法:System Sound ServicesAVAudioPlayer 类Audio Queue ServicesOpenAL1. System Sound ServicesSystem Sound Services 是最底层也是最简单的声音播放服务, 阅读全文
posted @ 2012-02-07 17:46 pengyingh 阅读(721) 评论(0) 推荐(0)
摘要: 1 //把图片转换为NSData 2 UIImage *image = [UIImage imageNamed:@"vim_go.png"]; 3 NSData *imageData = UIImagePNGRepresentation(image); 4 // post url 5 NSString *urlString = @"http://10.28.4.162/test-upload.php"; 6 7 // setting up the request object now 8 NSMutableURLRequest *request = [. 阅读全文
posted @ 2012-02-07 17:33 pengyingh 阅读(219) 评论(0) 推荐(0)
摘要: 1. 插入AppDelegate *app = [[UIApplication sharedApplication] delegate];NSManagedObjectContext *context = [app managedObjectContext];NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:@"entityname" inManagedObjectContext:context];[newManagedObject setValu 阅读全文
posted @ 2012-02-07 12:39 pengyingh 阅读(408) 评论(0) 推荐(0)
摘要: scroll view 原理在滚动过程当中,其实是在修改原点坐标当手指触摸后, scroll view会暂时拦截触摸事件,使用一个计时器,假如在计时器到点后,没有发生手指移动事件,那么,scroll view发送tracking events到被点击的subview假如在计时器到点前,发生了移动事件,那么 scroll view 取消tracking自己发生滚动子类可以重载touchesShouldBegin:withEvent:inContentView: 决定自己是否接收touch事件pagingEnabled当值是YES,会自动滚动到subview的边界,默认是NOtouchesShou 阅读全文
posted @ 2012-02-07 12:15 pengyingh 阅读(6822) 评论(0) 推荐(2)
摘要: 越狱后的手机的数据库文件可以自由访问,通话记录通常保存在call_History.db这个文件中.只要读取这个文件,我们就能知道目前手机的通话记录了下面这段代码检测手机是否能读取到Call_History.db 1 NSFileManager *fileManager = [NSFileManager defaultManager]; 2 NSDirectoryEnumerator *dirnum = [[NSFileManager defaultManager] enumeratorAtPath: @"/private/"]; 3 NSString *nextItem = 阅读全文
posted @ 2012-02-07 12:08 pengyingh 阅读(399) 评论(1) 推荐(0)
摘要: 所谓的短信截获,可以被程序提前接受到,经过过滤以及相应的处理,然后发送到手机的收件箱中。ios3上的短信截获通过可以通过一些私有的api即可完成,网上的教程也较多,这里不在重复。前段时间在调研的ios4上的短信截获,在网上也很难找到相应的,较完整的资料,刚好前段时间学习了hook,故周末抽了点时间使用hook重新调研了下,这里做个记录,以防止后期遗忘.测试环境: iphone4 ios4.3.2 已越狱1. 搭建hook demo开发环境,可以参照我的另一篇文章,这里不再重复。对接受短信的函数进行hook,并进行相应处理与过滤,在通过到手机上。2. class-dumpSMSCTServer. 阅读全文
posted @ 2012-02-07 12:04 pengyingh 阅读(380) 评论(0) 推荐(0)
摘要: 开发环境: iphone4 (ios4.3.2)使用hook截获系统处理通知事件,然后进行相应的处理来达到截获的效果。目前的截获不是很完美,黑名单中的人打电话时会先出现“嘟.."声之后才会提示所拨打的用户正在通话中……前提:需要class-dumpCoreTelephony framework,并配置hook开发环境1. 在说截获之前,先说说dlsym的使用我们通常会在网上看到一些函数具有我们需要的功能,然后我们在class-dump出的头文件中查找去找不到,但是使用grep在framework中确实可以搜索到相应的符号,导致使用上出现一些麻烦。此时我们就可以使用dlsym来从动态库 阅读全文
posted @ 2012-02-07 11:57 pengyingh 阅读(692) 评论(0) 推荐(0)
摘要: 随着微博、LBS 等移动互联网服务的火爆普及,越来越多的苹果开发者希望制作各网络服务的 iPhone 客户端。CocoaChina 会员 “qdvictory” 的《基于网络的客户端开发技巧》系列文章详细介绍了 iPhone 客户端应用的开发思路和注意事项,希望对苹果开发者们有所帮助。 一、做一个程序之前,要明确你要做的是什么。这之间道道不少,不仅仅要实现功能,还要考虑到程序功能之间是如何链接,用户如何交互。在这个基础上,才能和美工一起配合,把程序的设计做好,而仅仅的 UI,已经不能称得上是完整的设计了。利用 API 扩展是必需的,Open API 不是你自家的 API,所以肯定是有局限性的, 阅读全文
posted @ 2012-02-07 11:47 pengyingh 阅读(515) 评论(0) 推荐(0)
摘要: 想在应用里保存帐号、密码等信息的话,直接存到 plist 里显然是不负责任的,自己折腾加密既麻烦又不能保证不被反编译破解。实际上苹果 iOS 和 Mac OS X 系统自带了一套敏感信息保存方案:"钥匙串" (Keychain)。 用原生的 Security.framework 就可以实现钥匙串的访问、读写。但是只能在真机上进行,模拟器会出错。在 Github 上有个封装的非常好的类来实现这个功能,让你既能在模拟器又能在真机上访问钥匙串。类的地址:http://github.com/ldandersen/scifihifi-iphone/tree/master/securi 阅读全文
posted @ 2012-02-07 11:43 pengyingh 阅读(1014) 评论(0) 推荐(0)
摘要: 以前貌似发现相关尺寸,这次来点详细的,相信不少人用的到。。。。从icon说起命名方法,举例Icon.png 57×57Icon-72.png 72×72Icon-Small.png 29×29Icon-Small-50.png 50×50Icon@2x.png114×114Icon-Small@2x.png 58×58另iTunesArtwork 512×512在info.plist使用keyCFBundleIconFiles,注意与CFBundleIconFile区分开,CFBundleIconFiles的优先级高于CFB 阅读全文
posted @ 2012-02-07 11:28 pengyingh 阅读(206) 评论(0) 推荐(0)
摘要: [[NSWorkspace sharedWorkspace] openURLs: urls withAppBundleIdentifier:@"com.apple.Safari" options: NSWorkspaceLaunchDefaultadditionalEventParamDescriptor: NULLlaunchIdentifiers: NULL]; 阅读全文
posted @ 2012-02-07 11:26 pengyingh 阅读(386) 评论(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 阅读(748) 评论(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 阅读(331) 评论(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 阅读(936) 评论(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 阅读(2335) 评论(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 阅读(3858) 评论(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 阅读(546) 评论(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 阅读(860) 评论(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 阅读(447) 评论(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 阅读(255) 评论(0) 推荐(0)
摘要: If you want to optimize your content for iOS, then it is beneficial for you tolearn more about iOS hardware devices.Alpha-TestingContrary to the desktop, alpha-testing (or use ofdiscard/clipoperation in pixel shader) is very expensive on iOS. If you can replace your alpha-test shader with alpha-blen 阅读全文
posted @ 2012-02-07 08:47 pengyingh 阅读(5057) 评论(0) 推荐(0)
摘要: Trouble ShootingThis section address common problems you can find when using Unity, please choose the platform you are having problems at.Troubleshooting on iOS devicesThere are some known scenarios where your game works perfectly in the Unity iOS Editor but doesn't work or doesn't even star 阅读全文
posted @ 2012-02-07 08:42 pengyingh 阅读(1691) 评论(0) 推荐(0)
摘要: Customizing your Mobile target's Splash screenHow do I make a splash screen?As part of your game publishing process, you may want to customize the splash screen that appears when launching your game on the device. Unity iOS Basic users can choose between four different orientations of the includ 阅读全文
posted @ 2012-02-07 08:39 pengyingh 阅读(257) 评论(0) 推荐(0)
摘要: Preparing your application for "In App Purchases"This chapter doesnotaim to cover how to integrate your game with Apple's "StoreKit" API. It is assumed that you already have integration with "StoreKit" via anative code plugin.Apple's "StoreKit" documen 阅读全文
posted @ 2012-02-07 08:34 pengyingh 阅读(425) 评论(0) 推荐(0)
摘要: Plugins - Pro/Mobile-Only FeatureUnity has extensive support for C, C++ or Objective-C basedPlugins. Plugins allow your game code (written in Javascript, C# or Boo) to call into native code libraries. This allows Unity to integrate with other middleware libraries or legacy game code.Note:Plugins are 阅读全文
posted @ 2012-02-07 08:33 pengyingh 阅读(2227) 评论(0) 推荐(0)
摘要: Features currently not supported by Unity iOSGraphicsDXT texture compression is not supported; use PVRTC formats instead. Please see theTexture2D Component pagefor more information.Rectangular textures can not be compressed to PVRTC formats.Movie Textures are not supported; use a full-screen streami 阅读全文
posted @ 2012-02-07 08:32 pengyingh 阅读(267) 评论(0) 推荐(0)

导航