
iphone
文章平均质量分 76
wakin002
这个作者很懒,什么都没留下…
展开
-
通过例子分析Cocos2d-x的Resolution
例子:Use images for iPhone 5 in iPad.假设原图像大小是:1136 x 640 (For iPhone 5)Screen中实际的坐标系统是:1024 x 768 (iPad)Screen中预想的坐标系统是:480 x 320 (iPhone坐标)设置预想坐标和显示方式:CCEGLView::sharedOpenGLView()->s原创 2013-07-13 16:58:59 · 1268 阅读 · 0 评论 -
Tools Workflow Guide for iOS
Memo:https://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/00-About_the_iOS_Application_Development_Workflow/introduction.html原创 2013-02-25 11:18:04 · 507 阅读 · 0 评论 -
CFBundleVersion vs CFBundleShortVersionString
Questions:What's the difference betweenversion number in itunes connect(which you have to supply when you submit an update)bundle version in xcodebundle versions string, shortAnswer:转载 2013-02-25 10:44:50 · 549 阅读 · 0 评论 -
Keychain VS NSUserDefaults
Encryption will give you some security. The problem is your program would also have to decrypt the password, which means it must have the key stored in it somewhere. This will make it vulnerable to re转载 2013-03-08 09:18:17 · 1016 阅读 · 0 评论 -
NSUserDefaults
The NSUserDefaults docs state: "NSUserDefaults caches the information to avoid having to open the user’s defaults database each time you need a default value."Therefore it's no different to sett转载 2013-03-07 17:57:17 · 667 阅读 · 0 评论 -
App 申请时In App Purchase注意事项
最近,App申请被拒,原因是App In Purchase时返回receip无效的错误。经过调查发现,apple在审查的时候用的是sandbox的帐号,所以你必须在code中,先用production的url进行receipt的验证,如果返回21007的错误,再用sandbox的url进行验证。见Apple文档说明:How do I verify my receipt (iOS原创 2013-03-07 16:05:44 · 1387 阅读 · 0 评论 -
Memory management in block
Memory management in blockBlockの具体的な使い方はhttps://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.htmlを参考してください。Blockの使うのは二つ原创 2013-02-22 16:06:05 · 412 阅读 · 0 评论 -
Block 的内存管理
block 有什么意义,特点等等,这些东西,实在是太复杂了,这里只是简单的总结一下block的内存管理。而且也仅仅限于objective-C的部分Block memoryblock 的内存管理,应该是最头疼的地方,就用这个来自WWDC的例子来解释一下吧。当程序运行到这里时,stack 空间中有 shared 变量和 captured 变量。这里可以看出,__转载 2013-02-20 16:06:50 · 436 阅读 · 0 评论 -
iPhone: Detecting user inactivity/idle time since last screen touch
Has anybody implemented a feature where if the user has not touched the screen for a certain time period, you take a certain action? I'm trying to figure out the best way to do that.There's this s转载 2013-02-15 16:55:31 · 878 阅读 · 0 评论 -
Create an ad-hoc provisioning profile
Create an ad-hoc provisioning profileFrom time to time during the project, your developer will send a preview copy of the application. Because it's not coded for the AppStore yet, he has to us转载 2013-02-25 11:50:47 · 1352 阅读 · 0 评论 -
ASIHTTPRequest with SSL
How to implement a https connection with SSL and ASIHTTPRequest?To do ssl with ASIHTTPRequest, you just need to pass a https url instead of a http one.Are there some special steps to do? you d转载 2013-03-08 12:01:57 · 918 阅读 · 0 评论 -
【iPhone】Push Notificationの実装方法
【iPhone】Push Notificationの実装方法Posted by: daichi / Category: iphone開発新作でTwitter,はてな,Google Readerから横断的に情報収集し、マルチポストするアプリを作っているのですが、そこでTwitterのリプライPush機能を実装したので、Push Notificationを実装する方法をまとめてみま转载 2013-02-27 14:22:05 · 2306 阅读 · 0 评论 -
Work with KeyChain in IOS
What is keychain?A keychain is an encrypted container that holds passwords for multiple applications and secure services.We can use keychain to store multiple accounts in sercure FTP servers,原创 2013-01-24 11:26:21 · 643 阅读 · 0 评论 -
详解Objective-c Block应用
详解Objective-c block应用是本文要介绍的内容,主要介绍的是Objective-c block应用,不多说,先来看详细内容。Apple在C, Objective-C, C++加上Block這個延申用法。目前只有Mac 10.6 和iOS 4有支援。Block是由一堆可執行的程式組成,也可以稱做沒有名字的Function (Anonymous function)。如果是Ma转载 2013-05-21 09:31:31 · 577 阅读 · 0 评论 -
iOS UIControl 几个事件的说明
在控件事件中,简单解释下下面几个事件。说明:由于是在“iOS 模拟器”中测试的,所以不能用手指,只能用鼠标。1)UIControlEventTouchDown指鼠标左键按下(注:只是“按下”)的动作2)UIControlEventTouchDownRepeat指鼠标左键连续多次重复按下(注:只是“按下”)的动作,比如,鼠标连续双击、三击、……、多次连击。说明:多次重复按下时转载 2013-04-05 13:28:35 · 611 阅读 · 0 评论 -
Outlet in iOS and MacOS
Outlets - Property vs. Instance VariableWhen we were writing our iPhone programming book, all of Apple's sample code and documentation used the IBOutlet keyword exactly how we had always used转载 2013-04-05 13:27:05 · 875 阅读 · 0 评论 -
Class Cluster
UIButton is not a class cluster at all. A class cluster is represented by a public abstract class, that means no instance variables, with a bunch of private concrete subclasses that provide the impl转载 2013-04-04 15:36:40 · 750 阅读 · 0 评论 -
ASIHTTPRequest with Cookie
// creating the URLNSURL *_server_url = [NSURL URLWithString:@"http://my_computer.local/";];// creation the cookieNSHTTPCookie *cook = [NSHTTPCookie cookieWithProperties: [NSDictionary dicti转载 2013-04-01 14:22:01 · 584 阅读 · 0 评论 -
ASIHTTPRequest with Https
[request setValidatesSecureCertificate:NO]Since this is getting some upvotes, I'd just like to add that this might not be the best approach for valid SSL certificates. The one I was using was a self原创 2013-04-01 14:18:59 · 545 阅读 · 0 评论 -
ASIHTTPRequest "A connection failure occurred" error
iOS Development: Why do I always get the “A connection failure occurred” on the 1st attempt, but success on the next?I'm using the ASIHTTPRequest lib in my iOS app to make RESTful requests to my转载 2013-03-01 09:31:40 · 3634 阅读 · 0 评论 -
Archiving Objective-C Objects with NSCoding
For the seasoned Cocoa developer, this is a piece of cake. For newer developers, this can be a real pain, especially if you don't know what you're looking for. I get this question a decent amount, so转载 2013-02-14 08:54:36 · 392 阅读 · 0 评论 -
applicationWillEnterForeground vs. applicationDidBecomeActive, applicationWillResignActive vs. appli
When waking up i.e. relaunching an app (either through springboard, app switching or URL)applicationWillEnterForeground: is called. It is only executed once when the app becomes ready for use, after转载 2013-01-22 14:30:11 · 2219 阅读 · 0 评论 -
Deleted images remains
I removed images from xcode, yet they show up simulator and iphone.So if I used to have a sprite looking for "beach.png" i rename it "beach1.png" the app crashes, then put back "beach.png" app works原创 2013-01-26 15:43:25 · 335 阅读 · 0 评论 -
Timers VS Scheduler
Try NOT to use Cocoa’s NSTimer. Instead use cocos2d’s own scheduler.If you use cocos2d scheduler, you will have:automatic pause/resume.when the CCLayer (CCScene, CCSprite, CCNode) ente转载 2013-01-26 15:28:03 · 333 阅读 · 0 评论 -
iCloud(二)保存key value数据到iCloud
准备:1. Add iCloud in iTunes connect. And create a new provision file and entitlements. 具体请参考refs 1.2. Only devices support iCloud. Simulator不支持iCloud.3. Add your account in your devic原创 2013-01-24 13:22:25 · 2896 阅读 · 0 评论 -
Porting Over iPad game to iphone the easy way cocos2d
//Add this code after "make the OpenGLView a child of the view controller" in the AppDelegate.m //This will shrink the content of the ipad to fit on the iphone smoothly. if (UI_USER_INTERFAC转载 2013-01-26 15:44:20 · 385 阅读 · 0 评论 -
UIView + CCNode
1. CCNode + UIView - (OK)-(void) addSomeCocoaTouch {// regular text field with rounded cornersUITextField* textField = [[UITextField alloc] initWithFrame:CGRectMake(40, 20, 200, 24原创 2013-01-26 15:42:28 · 500 阅读 · 0 评论 -
开发适应iphone/ipad及多ios版本程序的技巧
本篇译自:Matt Gallagher的blog-http://cocoawithlove.com原文:http://cocoawithlove.com/2010/07/tips-tricks-for-conditional-ios3-ios32.html这篇日志会告诉你在ios编程中如何判断不同的版本的ios系统。1,让项目/Target支持不同版本的iOS要让一个程序可以在转载 2013-01-25 15:47:14 · 1079 阅读 · 0 评论 -
Porting Over iPad game to iphone the easy way cocos2d
//Add this code after "make the OpenGLView a child of the view controller" in the AppDelegate.m //This will shrink the content of the ipad to fit on the iphone smoothly. if (UI_USER_INTERFACE_ID转载 2013-01-25 15:39:12 · 419 阅读 · 0 评论 -
iCloud(一)综述
什么是iCloud?iCloud is a free service that lets users access their personal content on all their devices—wirelessly and automatically via Apple ID. iCloud does this by combining network-based stora原创 2013-01-24 12:01:48 · 1376 阅读 · 0 评论 -
深入理解iPhone数据持久化
From: http://www.cocoachina.com/iphonedev/sdk/2010/0611/1672.html在所有的移动开发平台数据持久 化都是很重要的部分:在j2me中是rms或保存在应用程序的目录中,在symbian中可以保存在相应的磁盘目录中和数据库中。symbian中因为权限认证的原因,在3rd上大多数只能访问 应用程序的private目录或其它系统共享目录。在i转载 2013-01-26 15:49:28 · 532 阅读 · 0 评论 -
IOS File System
IOS File SystemFigure 1-1 Each iOS app operates within its own sandbox/Application.app //bundle data, 只读/Documents // 存储critical user document and app data files./Library/tmpiCloud and原创 2013-01-26 15:54:42 · 824 阅读 · 0 评论 -
iOS5 ARC学习笔记
iOS5中加入了新知识,就是ARC,其实我并不是很喜欢它,因为习惯了自己管理内存。但是学习还是很有必要的。在iOS开发过程中,属性的定义往往与retain, assign, copy有关,我想大家都很熟悉了,在此我也不介绍,网上有很多相关文章。现在我们看看iOS5中新的关键字strong, weak, unsafe_unretained. 可以与以前的关键字对应学习st转载 2013-01-26 15:57:08 · 321 阅读 · 0 评论 -
IOS项目使用Git的正确步骤
0. git fetch0.1 git checkout master0.2 git pull orgin master //Get the new code from remote:master1. Create new branch by Xcode (local).2. work3. commit4. rebase(Do it before commit if necessary原创 2013-01-21 09:51:39 · 554 阅读 · 0 评论 -
Objective C 类变量的声明
Objective C中类变量的声明一般有两种方式:1)instance variable2)property方式声明instance variable方式声明如下:@interface MyClass : NSObject { NSString * _name;}如果你不想使用自动声明的set/get函数,则可以用这种方式。instance var原创 2013-02-03 17:55:31 · 1093 阅读 · 0 评论 -
Core Data in IOS
iPhone中persist data有很多方法,比如NSUserDefaults,NSKeyedArchiver,SQLite3,Core Data等等,具体请参照深入理解iPhone数据持久化。今天我们主要讨论Core data。Core data是存储not-trivial数据最好的一种,它可以降低内存负荷,增加可靠性,可以让你原理底层的数据库操作。Core Data主要是对sqli原创 2013-01-27 00:13:48 · 721 阅读 · 0 评论 -
Shader and Program编程基本概念
一、本文关注的问题:• Shader and program 对象介绍• 创建并编译一个Shader对象• 创建并链接一个Program对象• 获取并设置uniforms• 获取并设置attributes 在OpenGL ES中,每个program对象有且仅有一个Vertex Shader对象和一个Fragment Shader对象连接到它。 Shader:类似于C转载 2013-01-28 10:02:07 · 946 阅读 · 0 评论 -
Objective-C基础教程学习笔记 内存管理
每个对象都维护一个保留计数器。对象被创建时,其保留计数器值1;对象被保留时,保留计数器值加1;对象被释放时,保留计数器值减1;当保留计数器值归0时,对象被销毁。在销毁对象时,首先调用对象的dealloc方法,然后回收其占用的内存以供其它对象使用。当对象接收一条autorealse消息时,其保留计数器并不立即改变。相反,该对象只被放入NSAutoreleasePool中。当自动释放池被销毁时转载 2013-01-26 16:04:59 · 523 阅读 · 0 评论 -
AudioServicesPlaySystemSound音频服务—IOS开发
From: http://blog.youkuaiyun.com/iukey/article/details/7296107对于简单的、无混音音频,AVAudio ToolBox框架提供了一个简单的C语言风格的音频服务。你可以使用AudioservicesPlaySystemSound函数来播放简单的声音。要遵守以下几个规则:1.音频长度小于30秒2.格式只能是PCM或者IMA4转载 2013-01-26 16:02:42 · 415 阅读 · 0 评论 -
In-app purchase [Environment: Sandbox] bug
BUG:I cant test my in-app purchases because I am always getting this error message: Verification Required: before you can make purchases, you must verify your payment info [Environment: Sandbox]转载 2013-01-23 16:30:42 · 1394 阅读 · 0 评论