Fork me on GitHub

2012年2月6日

摘要: iOS Hardware GuideHardware modelsFollowing table summarizes iOS hardware available in devices of various generations:Common to all iOS devicesScreen: 320x480 pixels, LCD at 163ppi (unless stated otherwise)Built-in accelerometerWi-FiOriginal iPhoneARM11, 412 Mhz CPUPowerVR MBX Lite 3D graphics proces 阅读全文
posted @ 2012-02-06 13:36 pengyingh 阅读(220) 评论(0) 推荐(0)
摘要: Advanced iOS scriptingDetermining Device GenerationDifferent device generations support different functionality and widely varying performance. You should query the device for its generation and decide which functionality should be disabled to compensate for slower devices.You can retrieve device ge 阅读全文
posted @ 2012-02-06 13:35 pengyingh 阅读(206) 评论(0) 推荐(0)
摘要: Mobile KeyboardSometimes when developing your game you might need to have access to the keyboard Input that your target platform provides, this is done straight forward in unity just by calling some attributes via scripting.Using the KeyboardGUI ElementsThe keyboard will appear automatically when a 阅读全文
posted @ 2012-02-06 13:33 pengyingh 阅读(260) 评论(0) 推荐(0)
摘要: Mobile InputUnity iOS/Android offers you access to the iPhone, iPad and Android input systems viaInputandiOS Inputscripting interfaces.Inputprovides access to the multi-touch screen, accelerometer and device orientation.iOS Inputprovides access to geographical location.Access to keyboard on mobile d 阅读全文
posted @ 2012-02-06 13:32 pengyingh 阅读(378) 评论(0) 推荐(0)
摘要: Unity iOS BasicsThis section covers the most common and important questions that come up when starting to work with iOS.PrerequisitesI've just received iPhone Developer approval from Apple, but I've never developed for iOS before. What do I do first?A: Download the SDK, get up and running on 阅读全文
posted @ 2012-02-06 13:31 pengyingh 阅读(300) 评论(0) 推荐(0)
摘要: Unity RemoteUnity Remote is a software application that makes your iPhone/iPad act as a remote control for your project in Unity. This is useful for rapid development when you don't want to compile and deploy your project to device for each change and prefer to use the Editor Game window instead 阅读全文
posted @ 2012-02-06 13:31 pengyingh 阅读(724) 评论(0) 推荐(0)
摘要: Getting Started with iOS DevelopmentDeveloping for the iOSBuilding games for devices like the iPhone/iPad requires a different approach than targeting the home PC market. Unlike the PC market, your target hardware is standardized and not as fast or powerful as a computer with a dedicated video card. 阅读全文
posted @ 2012-02-06 13:29 pengyingh 阅读(549) 评论(0) 推荐(0)
摘要: For security purposes, an iOS application has limited number of places where it can write its data. When an application is installedon a device, iTunes creates a home directory for the application. This directory represents the universe for that application and contains everything the application ca 阅读全文
posted @ 2012-02-06 13:24 pengyingh 阅读(807) 评论(0) 推荐(0)
摘要: NOTE:从一个设备备份,刷机之后可以恢复游戏进度。同一个游戏同一个icloud ID在不同设备上,要看游戏本身是不是支持云,支持的话,A设备打到第几关,B设备的进度也是第几关(忽略网络延时)如果不支持,相当于两个不同的游戏。1. iCloud如何备份?iCloud 自动备份 iOS 5 设备上最重要的数据。在 iPhone、iPad 或 iPod touch 上,通过设置 > iCloud > 储存与备份启用了“备份”之后,只要您的设备处于以下状态,每天就会运行备份:通过 Wi-Fi 连接到互联网连接到电源锁定屏幕另外,只要从设置 > iCloud > 储存与备份中选 阅读全文
posted @ 2012-02-06 13:23 pengyingh 阅读(805) 评论(0) 推荐(0)
摘要: iCloud StorageiCloud storage is a set of interfaces and services for sharing data among instances of your app running ondifferent devices. The idea behind iCloud is to provide a single place where your app can write its data. Changes made by one instance of your app are propagated to the user’s othe 阅读全文
posted @ 2012-02-06 13:22 pengyingh 阅读(963) 评论(0) 推荐(0)
摘要: Storyboards are the new way to define your application’s user interface. In the past, you used nib files to define your user interface one view controller at a time. A storyboard file captures your entire user interface in one place and lets you define both the individual view controllers and the tr 阅读全文
posted @ 2012-02-06 13:21 pengyingh 阅读(417) 评论(0) 推荐(0)
摘要: Create, Set Up, and Apply FiltersListing 2-5shows how to create, set up, and apply a hue filter. You use thefilterWithName:method to create a filter whose type is specified by thenameargument. The hue adjust filter is named CIHueAdjust. You can obtain a list of filter names by following the instruct 阅读全文
posted @ 2012-02-06 13:17 pengyingh 阅读(1206) 评论(0) 推荐(0)
摘要: Core Image is an image processing technology built into Mac OS X v10.4 and iOS 5.0 that leverages programmable graphics hardware whenever possible to provide near real-time processing. The Core Image application programming interface (API) provides access to built-in image filters for both video and 阅读全文
posted @ 2012-02-06 13:16 pengyingh 阅读(2093) 评论(0) 推荐(0)
摘要: Twitter FrameworkThe Twitter framework (Twitter.framework) provides support for sending Twitter requests on behalf of the user and for composing and sending tweets. For requests, the framework handles the user authentication part of the request for you and provides a template for creating the HTTP p 阅读全文
posted @ 2012-02-06 13:13 pengyingh 阅读(279) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/5509/beginning-turn-based-gaming-with-ios-5-part-2Sending a TurnWe need to set up a method that sends a turn. When it’s our turn, we want to be able to add a string of text (max 250 characters) to the end of the current story. When we send a turn, we’ll add our text 阅读全文
posted @ 2012-02-06 13:03 pengyingh 阅读(257) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/5480/beginning-turn-based-gaming-with-ios-5-part-1In iOS5, Game Center has a new API that makes it even easier to create another type of game – turn-based games!This new API is perfect for board games, turn based strategy, word games, and other types of casual turn 阅读全文
posted @ 2012-02-06 13:02 pengyingh 阅读(368) 评论(0) 推荐(0)
摘要: Unsafe_unretainedWe’re almost done covering the basics of ARC – I just wanted to mention one more thing you should know.Besides strong and weak there is another new modifier, unsafe_unretained. You typically don’t want to use that. The compiler will add no automated retains or releases for variables 阅读全文
posted @ 2012-02-06 13:01 pengyingh 阅读(316) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/5773/beginning-arc-in-ios-5-tutorial-part-2Converting By HandWe’ve converted almost the entire project to ARC already, except for MainViewController and AFHTTPRequestOperation. In this section I’ll show you how to convert MainViewController by hand. Sometimes it’s f 阅读全文
posted @ 2012-02-06 12:59 pengyingh 阅读(773) 评论(0) 推荐(0)
摘要: 转载:http://blog.csdn.net/favormm/article/details/7023322iOS5中加入了新知识,就是ARC,其实我并不是很喜欢它,因为习惯了自己管理内存。但是学习还是很有必要的。在iOS开发过程中,属性的定义往往与retain, assign, copy有关,我想大家都很熟悉了,在此我也不介绍,网上有很多相关文章。现在我们看看iOS5中新的关键字strong, weak, unsafe_unretained. 可以与以前的关键字对应学习strong与retain类似,weak与unsafe_unretained功能差不多(有点区别,等下会介绍,这两个新关键 阅读全文
posted @ 2012-02-06 12:58 pengyingh 阅读(1379) 评论(0) 推荐(0)
摘要: 17. GradientsQuartz provides two opaque data types for creating gradients—CGShadingRefandCGGradientRef. You can use either of these to create axial or radial gradients. Agradientis a fill that varies from one color to another.Anaxial gradient(also called alinear gradient) varies along an axis betwee 阅读全文
posted @ 2012-02-06 12:55 pengyingh 阅读(699) 评论(0) 推荐(0)
摘要: 1. Quartz 2D 是mac os和iOS下的2d图形绘制引擎。2.Quartz 2D uses thepainter’s model(绘画者模式)for its imaging. In the painter’s model, each successive drawing operation applies a layer of “paint” to an output “canvas,” often called apage. The paint on the page can be modified by overlaying more paint through additio 阅读全文
posted @ 2012-02-06 12:54 pengyingh 阅读(1392) 评论(0) 推荐(0)
摘要: 原文地址:http://zonble.net/archives/2010_06/1330.php在使用到这些类中加头文件,例如1. #import "CTCarrier.h"2. #import "CTTelephonyNetworkInfo.h"iOS 4.0 的官方 API 里头,多了一个叫做 Core Telephony 的 framework;一直以来 Core Telephony 都是 private API,现在开放出来,但是从文件来看,里头根本没有几行,既没有告诉你应该怎么用,也没有范例,你从 framework 里头寥寥四个 class 阅读全文
posted @ 2012-02-06 12:52 pengyingh 阅读(520) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/5235/beginning-opengl-es-2-0-with-glkit-part-2?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+RayWenderlich+(Ray+Wenderlich+|+iPhone+Developer+and+Gamer)In this second and final part of the tutorial, now that you know the basics we can get to the f 阅读全文
posted @ 2012-02-06 09:38 pengyingh 阅读(419) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/5223/beginning-opengl-es-2-0-with-glkit-part-1iOS 5 comes with a new set of APIs that makes developing with OpenGL much easier than it used to be.The new set of APIs is collectively known as GLKit. It contains four main sections:GLKView/GLKViewController. These clas 阅读全文
posted @ 2012-02-06 09:36 pengyingh 阅读(811) 评论(0) 推荐(0)
摘要: Note from Ray:Congratulations, you guys did it! By helping to spread the word about theiOS 5 Feast, you guys unlocked the first iOS 5 tutorial early! Enjoy!This is a blog post by iOS Tutorial Team memberSteve Baranski, the founder ofkomorka technology, a provider of iOS development and consulting se 阅读全文
posted @ 2012-02-06 09:09 pengyingh 阅读(630) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/5191/beginning-storyboards-in-ios-5-part-2In this second and final part of the tutorial series, we’ll cover segues, static table view cells, the add player screen, and a game picker screen!Introducing SeguesIt’s time to add more view controllers to our storyboard. W 阅读全文
posted @ 2012-02-06 09:04 pengyingh 阅读(498) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1Getting StartedFire up Xcode and create a new project. We’ll use the Single View Application template as our starting point and then build up the app from there.Fill in the template options as follows:Product Name: RatingsCo 阅读全文
posted @ 2012-02-06 09:02 pengyingh 阅读(664) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/6031/beginning-icloud-in-ios-5-tutorial-part-2Setting Up the User InterfaceThe Xcode project template we chose already set up an empty view controller for us. We will extend it by adding the current document and a UITextView to display the content of our note.Start 阅读全文
posted @ 2012-02-06 08:52 pengyingh 阅读(251) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/6015/beginning-icloud-in-ios-5-tutorial-part-1Note to get the most out of this tutorial, you will need two physical iOS devices running iOS 5 for testing, such as an iPhone and an iPad. The simulator does not currently have iCloud support.Under the HoodBefore we beg 阅读全文
posted @ 2012-02-06 08:50 pengyingh 阅读(538) 评论(0) 推荐(0)
摘要: ABAddressBookRef addressBook = ABAddressBookCreate();CFArrayRef results = ABAddressBookCopyArrayOfAllPeople(addressBook);for(int i = 0; i < CFArrayGetCount(results); i++){ABRecordRef person = CFArrayGetValueAtIndex(results, i);//读取firstnameNSString *personName = (NSString*)ABRecordCopyValue(perso 阅读全文
posted @ 2012-02-06 08:36 pengyingh 阅读(358) 评论(0) 推荐(0)
摘要: 这段时间N忙,没办法,创业公司,当然抽时间也仍然再自学ios~OK,基础的语言基础,我就不多说了,从今天开始直接写游戏开发部分了;声明一点:iOS游戏开发系列没有我写的Android游戏开发系列有权威性,因为我也是在学习中,只是拿出来给大家分享,希望大家不要较真,现在咱们都是一年级新生,咳咳,好啦,不多说了,下面开始进入正题; 绘制一个图形,首先我们肯定需要一个视图view,在iOS中是UIView,下面用两种方式介绍如何在iphone上显示视图; 首先创建一个项目:(Window-based Application) 然后新建一个自定义的GameView类,继承UIView类; Ok,除了继 阅读全文
posted @ 2012-02-06 01:15 pengyingh 阅读(368) 评论(0) 推荐(0)
摘要: 最近几天仔细了解了iOS游戏开发引擎,常用的cocos2d,Unity引擎,那么Unity是非免费的,而cocos2d则是免费开源的; 最后促使我选择cocos2d的原因有两点: 1.最重要的原因是它对应的开发工具,尤其是 “ParticleDesigner”,粒子系统编辑器,非常的喜欢(需付费$7.99美元),下载试用版操作了以下,没说的,狠给力;截图如下:(当时就掏出信用卡去购买,只是突然有点小意外,没买上,咳咳、以后再说)2.其cocos2d-x的跨平台挺看好,因为我也开发android系统,也清楚在android游戏引擎上cocos2d也有其对应的版本;这样一款引擎可以两平台都... 阅读全文
posted @ 2012-02-06 01:13 pengyingh 阅读(1017) 评论(0) 推荐(0)
摘要: 原文地址:http://www.raywenderlich.com/6063/uikit-particle-systems-in-ios-5-tutorial?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+RayWenderlich+(Ray+Wenderlich+|+iPhone+Developer+and+Gamer)You’ve probably seen particle systems used in many different iOS apps and games for explosions, 阅读全文
posted @ 2012-02-06 01:01 pengyingh 阅读(509) 评论(0) 推荐(0)
摘要: 原文地址:http://www.cnblogs.com/ydhliphonedev/archive/2011/09/05/2167184.html在ViewController中重写touch的事件的方法体就可实现特定的touch功能(但这些touch事件会被加在之上的tableView或scrollView等屏蔽,希望知道解决方案的留下方法).下面代码实现清扫事件- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { messageLabel.text =@"Touches Began"; // 阅读全文
posted @ 2012-02-06 00:57 pengyingh 阅读(4843) 评论(0) 推荐(0)
摘要: http://www.cocoachina.com/bbs/read.php?tid=90544&page=1试了一下,该功能在5.0以下的系统不支持。在代码中调用如下代码:NSURL*url=[NSURL URLWithString:@"prefs:root=WIFI"];[[UIApplication sharedApplication] openURL:url];即可跳转到设置页面的对应项。[font=]About — prefs:root=General&path=AboutAccessibility — prefs:root=General& 阅读全文
posted @ 2012-02-06 00:52 pengyingh 阅读(269) 评论(0) 推荐(0)
摘要: 当旋转CCNode时,anchorPoint决定该CCNode旋转的原点;当缩放CCNode时,anchorPoint决定该CCNode缩放的原点;当设定CCNode的position时,anchorPoint决定该CCNode的哪个点位于position。比如一个CCSpirte的anchorPoint在(0.0f, 0.0f),position在(100, 100),则这个CCSprite的左下角将被放在(100, 100)处。下面的公司可以用于CCNode的实际位置(实际位置的意思是该CCNode中心点的位置)actualPosition.x = position.x + width*( 阅读全文
posted @ 2012-02-06 00:51 pengyingh 阅读(891) 评论(0) 推荐(0)
摘要: Operation Objects:Anoperation objectis an instance of theNSOperationclass (in the Foundation framework) that you use to encapsulate work you want your application to perform. TheNSOperationclass itself is an abstract base class that must be subclassed in order to do any useful work. Despite being ab 阅读全文
posted @ 2012-02-06 00:50 pengyingh 阅读(813) 评论(0) 推荐(0)
摘要: Threads introduce a tremendous amount of overhead to your process, both in terms of memory consumption and CPU time. 除非有必要,尽量不要使用Threads.Run Loop:A run loop is a piece of infrastructure used to manage events arriving asynchronously on a thread. A run loop works by monitoring one or more event source 阅读全文
posted @ 2012-02-06 00:49 pengyingh 阅读(523) 评论(0) 推荐(0)
摘要: 格式化参数如下:G: 公元时代,例如AD公元yy: 年的后2位yyyy: 完整年MM: 月,显示为1-12MMM: 月,显示为英文月份简写,如 JanMMMM: 月,显示为英文月份全称,如 Janualydd: 日,2位数表示,如02d: 日,1-2位显示,如 2EEE: 简写星期几,如SunEEEE: 全写星期几,如Sundayaa: 上下午,AM/PMH: 时,24小时制,0-23K:时,12小时制,0-11m: 分,1-2位mm: 分,2位s: 秒,1-2位ss: 秒,2位S: 毫秒常用日期结构:yyyy-MM-dd HH:mm:ss.SSSyyyy-MM-dd HH:mm:ssyyyy 阅读全文
posted @ 2012-02-06 00:44 pengyingh 阅读(6942) 评论(0) 推荐(1)
摘要: TheUIViewControllerclass provides the fundamental view-management model for iPhone applications. It provides automatic support for rotating the views of the view controller in response to changes to the orientation of the device. If the autoresizing properties of your view and subviews are properly 阅读全文
posted @ 2012-02-06 00:42 pengyingh 阅读(793) 评论(0) 推荐(0)
摘要: [NSDate date]获取的是GMT时间,要想获得某个时区的时间,以下代码可以解决这个问题NSDate*date = [NSDatedate];NSTimeZone*zone = [NSTimeZonesystemTimeZone];NSIntegerinterval = [zonesecondsFromGMTForDate: date];NSDate*localeDate = [datedateByAddingTimeInterval: interval]; NSLog(@"%@", localeDate); 阅读全文
posted @ 2012-02-06 00:37 pengyingh 阅读(16372) 评论(1) 推荐(1)
摘要: 今天中午,我突然想搞清楚Unicode和UTF-8之间的关系,于是就开始在网上查资料。结果,这个问题比我想象的复杂,从午饭后一直看到晚上9点,才算初步搞清楚。下面就是我的笔记,主要用来整理自己的思路。但是,我尽量试图写得通俗易懂,希望能对其他朋友有用。毕竟,字符编码是计算机技术的基石,想要熟练使用计算机,就必须懂得一点字符编码的知识。1. ASCII码我们知道,在计算机内部,所有的信息最终都表示为一个二进制的字符串。每一个二进制位(bit)有0和1两种状态,因此八个二进制位就可以组合出 256种状态,这被称为一个字节(byte)。也就是说,一个字节一共可以用来表示256种不同的状态,每一个状态 阅读全文
posted @ 2012-02-06 00:34 pengyingh 阅读(226) 评论(0) 推荐(0)
摘要: iOS从4.0之后支持后台播放声音了。下面是实现声音文件播放,并且用户关闭屏幕之后仍然能够播放声音文件。具体的实现方法如下:在plist文件中加入下面的字段:声明内容如下:Info.plist中添加UIBackgroundModes键值,它包含一个或多个string的值,包括audio:在后台提供声音播放功能,包括音频流和播放视频时的声音location:在后台可以保持用户的位置信息voip:在后台使用VOIP功能在程序中添加:AVAudioSession *session = [AVAudioSession sharedInstance];[session setActive:YES err 阅读全文
posted @ 2012-02-06 00:27 pengyingh 阅读(6887) 评论(0) 推荐(0)
摘要: 如果想要在drwaRect方法中自己绘制试图,一定要确保该view不从UIImageView派生。 阅读全文
posted @ 2012-02-06 00:24 pengyingh 阅读(533) 评论(0) 推荐(0)
摘要: 首先在UIViewController的-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation方法中设置设备要支持的deviceOrientation;在UIViewController的-(void)willRotateToInterfaceOrientation(UIInterfaceOrientation)toInterfaceOrientationduration:(NSTimeInterval)duration或者-(void)willAnimateRotat 阅读全文
posted @ 2012-02-06 00:20 pengyingh 阅读(12864) 评论(0) 推荐(0)
摘要: UIView *view = [[[[[UIApplication sharedApplication] windows] objectAtIndex:1] subviews] lastObject];//获得某个window的某个subViewNSInteger index = 0;//用来给保存的png命名for (UIView *subView in [view subviews]) {//遍历这个view的subViewsif ([subView isKindOfClass:NSClassFromString(@"UIImageView")] || [subView 阅读全文
posted @ 2012-02-06 00:19 pengyingh 阅读(203) 评论(0) 推荐(0)
摘要: 1. Animation Classes RoadmapCore Animation provides an expressive set of animation classes you can use in your application:CAAnimationis the abstract class that all animations subclass.CAAnimationadopts theCAMediaTimingprotocol which provides the simple duration, speed, and repeat count for an anima 阅读全文
posted @ 2012-02-06 00:15 pengyingh 阅读(447) 评论(0) 推荐(0)
摘要: (3)Adopting the CAAction ProtocolTheCAActionprotocol defines how action objects are invoked. Classes that implement theCAActionprotocol have a method with the signaturerunActionForKey:object:arguments:.When the action object receives therunActionForKey:object:arguments:message it is passed the actio 阅读全文
posted @ 2012-02-06 00:14 pengyingh 阅读(288) 评论(0) 推荐(0)
摘要: Core Animation provide an abstract animation interface that allows animations to run on a separate thread, independent of your application's run loop. Once an animation is configured and starts, Core Animation assumes full responsibility for running it at frame rate.Core Animation classes can be 阅读全文
posted @ 2012-02-06 00:13 pengyingh 阅读(543) 评论(0) 推荐(0)

导航