Time of Update: 2018-12-05
from: http://www.cocoachina.com/iphonedev/sdk/2011/0506/2840.html 利用 CALayer 可以實現複雜的動畫效果,同時 CALayer 在運動過程中,需要點擊 CALayer,同時能夠監控到點擊的對象。下面是實現的效果和過程。 實現過程: #import AnimView.h @implementation Ani 利用 CALayer 可以實現複雜的動畫效果,同時 CALayer 在運動過程中,需要點擊
Time of Update: 2018-12-05
My laptop is Thinkpad X61,with only 160GB harddisk. Although I use 25GB for Mac OS fordeveloping, it's still not enough, especially when I need to update theiPhone's SDK.Each time when I update theSDK, I need to uninstall the Xcode to release at
Time of Update: 2018-12-05
如果你在某個項目中不打算用IB,那麼你可以從整個項目中整個剔除掉IB部分。按照下面的步驟做完之後,你的項目將不在使用IB的NIB檔案,也不在從中擷取UI的預設布局資訊,這就意味著你將自己編碼,支援視窗、視圖和其他對象。是否使用UI是開發人員的喜好問題。刪除IB的步驟如下:開啟你新建立的項目,展開項目中的Resources檔案夾,刪除裡面以.xib結尾的檔案。在Resources檔案夾下,修改Info.plist的檔案。 將IB從你的應用程式中卸載之後,你將手工指定應用程式代理程式類的名字。例
Time of Update: 2018-12-05
1. 在UIView中,將該view使用到的座標進行旋轉,這樣當該view addSubview時,會使用座標方向來進行:@implementation PoseDetailContentView- (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { // Important here, rotate THIS UIView [self
Time of Update: 2018-12-05
From:http://b.imi.im/?p=388-(NSArray*)getPagesOfString:(NSString*)cache withFont:(UIFont*)font inRect:(CGRect)r{//返回一個數組, 包含每一頁的字串開始點和長度(NSRange)NSMutableArray *ranges=[NSMutableArray array];//斷行類型UILineBreakMode
Time of Update: 2018-12-05
感謝cocoachina.com添加聲音[[SimpleAudioEngine sharedEngine] preloadBackgroundMusic:@"xxx.xxx"] -(BOOL)canBecomeFirstResponder; // default is NO- (BOOL)becomeFirstResponder;- (BOOL)canResignFirstResponder; // default is YES-(BOOL)resignFirstResponder;
Time of Update: 2018-12-05
要寫遊戲首先希望螢幕繪製能定時重新整理,那麼我們就開一個定時器。固定時間重新整理螢幕。定時器是在initWithFrame中開啟的 mTimer = [NSTimer scheduledTimerWithTimeInterval:0.017 //多少秒重新整理一次 target:self selector: @selector(update:) userInfo:nil repeats:YES]; fps=60,希望能這樣。呵呵。 我的重新整理函數是 update;
Time of Update: 2018-12-05
原來簡單解釋過屬性定義(Property) ,並且提起了簡單的retain,copy,assign的區別。那究竟是有什麼區別呢?assign就不用說了,因為基本上是為單一資料型別準備的,而不是NS對象們。Retain vs. Copy!!copy: 建立一個索引計數為1的對象,然後釋放舊對象retain:釋放舊的對象,將舊對象的值賦予輸入對象,再提高輸入對象的索引計數為1那上面的是什麼該死的意思呢?Copy其實是建立了一個相同的對象,而retain不是:比如一個NSString對象,地址為0×1
Time of Update: 2018-12-05
[[session inputStream] scheduleInRunLoop:[NSRunLoop currentRunLoop]
Time of Update: 2018-12-05
from:http://www.cocoachina.com/bbs/read.php?tid-10884-fpage-2-page-1.htmlhttp://www.codza.com/free-iphone-app-version-from-the-same-xcode-project啥叫多Targets, 有啥用! 相信很多人都注意到XCode中, 有個Target的概念. 這在很多地方都有所體現, 比如開啟一個工程後, 左側的列表中有Targets一項,
Time of Update: 2018-12-05
轉自UIViewController A下添加了一個navigationcontroller,通過navigationcontroller的pushViewController ,A 切換到B,然後再從B切換回A,此時,如何通知A
Time of Update: 2018-12-05
本文轉自 http://wangjun.easymorse.com/?p=1093iOS 系統內建的 View 組件都是正方形的,看起來都太生硬,有時候我需要變成圓角形式,如: 具體的實現是使用QuartzCore庫,下面我具體的描述一下實現過程:首先建立一個項目,名字叫:ipad_webwiew利用Interface Builder添加一個UIWebView,然後和相應的代碼相關聯添加QuartzCore.framework 代碼實現:標頭檔: #import
Time of Update: 2018-12-05
from:http://www.cocoachina.com/bbs/read.php?tid=21718關於universal類型項目的compile distribute設置的一點經驗分享 universal類型項目的審核還是很快的,這一點apple的測試審核人員值得表揚。不過在現階段OS 3.1.3當道,最後分發編譯的時候需要做如下設置,而不僅僅是先前部分朋友所說的選擇iPhone 3.2 SDK,否則會被打回重新編譯。Base SDK = iphone device
Time of Update: 2018-12-05
NSData * UIImageJPEGRepresentation ( UIImage *image, CGFloat compressionQuality);複製代碼和NSData * UIImagePNGRepresentation ( UIImage *image);複製代碼寫
Time of Update: 2018-12-05
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth, float ovalHeight){ float fw, fh; if (ovalWidth == 0 || ovalHeight == 0) { CGContextAddRect(context,
Time of Update: 2018-12-05
自訂Navigation和NavigationItemfrom http://www.codeios.com/thread-97-1-1.html #import "NavTest.h" @implementation UINavigationBar (CustomImage) //定義navigation背景圖片- (void)drawRect:(CGRect)rect { UIImage *image = [UIImage imageNamed: @"bg.png"];
Time of Update: 2018-12-05
iPhone上的程式很多用表格UITableView來顯示資料、做布局等。 當用UITableView顯示資料是經常會需要刪除、插入資料條目。 SDK提供兩種刪除UITableViewCell的方法設定整個表格為編輯模式,如果沒有做其他編輯風格(editing style),就會在每個儲存格左面有一個圓形紅色刪除按鈕,點擊該按鈕會在右邊顯示“Delete”按鈕 在儲存格上划動,會在划動的儲存格右邊顯示“Delete”按鈕, 這是SDK提供的快捷刪除儲存格的方法, 官方說法是 swipe to
Time of Update: 2018-12-05
OpenGL ES on the iPhone is a cinch to set up with Xcode, especiallysince Apple introduced the template with the SDK release. All we reallyneed is a place where you can get to and start adding in code quicklyand easily. This is what we’re going to do
Time of Update: 2018-12-05
這兩天在寫iPad的東西,剛好看到這個好用的新Class,iPhone OS3.2以後大概都會有,官方範例只有兩種,在這裡幫大家簡單整理一下用法 在3.2以前,我們要拿到UITouch跟使用者互動,大部分都是透過UIResponder的四種methods- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event- (void)touchesCancelled:(NSSet *)touches
Time of Update: 2018-12-05
1。工程中引入MediaPlayer。FrameWork2。在EAGLView。mm中加入論壇裡找到的那幾個調用MPMoviePlayerController的方法: