Time of Update: 2018-12-05
1.block 用到的局部變數是 唯讀,將關鍵字__block 定義局部變數 則變為可讀寫。2.如果局部變數類型是 基礎資料型別 (Elementary Data Type),比如NSinteger,那麼block使用局部變數其實是其拷貝,類似於函數參數傳值方式,所以在定義block之後修改局部變數對block代碼塊的內容沒有影響。NSInteger outNum11 = 10; NSInteger (^blockOne11)(NSInteger) = ^(NSInteger a){NSLog(
Time of Update: 2018-12-05
參考:[1]蘋果官方[2]三種編程命名規則(匈牙利法,小駝峰法,大駝峰法)以下主要是針對Coding Guidelines for Cocoa 的個人讀書筆記,主要列舉個人容易違反的若干內容,詳細內容見參考一。1.清晰性、一致性1)蘋果一般採用小駝峰命名法,即第一個單詞首字母小寫,後面其他單字首大寫,例如:codeName。2)命名應該簡潔清晰,不會產生歧義,並且不提倡採用縮寫,堅持用全拼。3)命名應具有一致性,例如:多個類中具有相同功能的方法應該具有相同名稱,這樣讓人想到就能使用。2.首碼1)
Time of Update: 2018-12-05
MPMoviePlayerViewController和MPMoviePlayerController
Time of Update: 2018-12-05
參考:[1]http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_affine/dq_affine.html#//apple_ref/doc/uid/TP30001066-CH204-CJBECIAD[2]http://www.cnblogs.com/delonchen/archive/2011/08/03/iostransform.htmlQ
Time of Update: 2018-12-05
參考[1]http://developer.apple.com/library/ios/#documentation/MacOSX/Conceptual/BPInternational/Articles/LocalizingPathnames.html#//apple_ref/doc/uid/20002141-BBCFJBFBapp如果會在不同的國家發行,那麼就需要為app做本地化或者叫國際化,根據device的語言類型來選擇對應的資源,顯示正確的表徵圖,文字等。另外,網上搜了下本地化,發現由於
Time of Update: 2018-12-05
一些iphone的小細節,小技巧1.時間戳記[cpp] view plaincopyNSTimeInterval interval = [[NSDate date] timeIntervalSince1970]; NSString* timeStamp = [NSString stringWithFormat:@"hex=%x,dec=%d,milSec=%.3f",(NSInteger)interval,(NSInteger)interval,interval]; timeStamp
Time of Update: 2018-12-05
概述UIWindow類定義的對象(如Windows)管理和協調應用程式顯示在螢幕上的視窗。一個視窗的兩個主要職能是,顯示view和分發事件。window是同一層上的根view,每一層上都有一個window. 在第一層出現的視窗要大於其他層,例如,警報出現高於正常的視窗。通常情況下,在IOS應用程式只有一個視窗。當建立在Interface
Time of Update: 2018-12-05
一、~~~ the + ~ est + 名詞 + (that) + 主詞 + haveever + seen ( known/heard/had/read, etc) ~~~ the most + 形容詞 + 名詞 + (that) + 主詞 + have ever + seen ( known/heard/had/read, etc) 例句: Helen is the most beautiful girl that I have ever seen. 海倫是我所看過最美麗的女孩。 Mr.
Time of Update: 2018-12-05
參考:[1]http://www.fwolf.com/blog/post/346sed是*nix下方便的行編輯工具,經常用來替換檔案的內容,sed一般都是處理單行的,但通過它的一些內建功能,也能實現跨行替換(即要替換的內容有多行內容)。解決方案主要來自網上搜到的一篇文章,但文中的大俠並沒有解釋得特別清楚,我對照著其他兩個更晦澀的例子(一、二),結合man搞懂了之後,記錄於此。假設我們的目標檔案test內容是這樣的:file content aabbcc<<<comment
Time of Update: 2018-12-05
原文地址:http://blog.csdn.net/pjk1129/article/details/72551631.靜態庫工程的建立:Xcode New一個新的project,選擇IOS下面的Framework&Library,下面有一個Cocoa Touch Static Library。直接next去建立一個Print這樣的工程。2.工程建立我們添加很簡單的"-
Time of Update: 2018-12-05
- (NSString *)macaddress{ int mib[6]; size_t len; char *buf; unsigned char *ptr; struct if_msghdr *ifm; struct sockaddr_dl *sdl; mib[0] = CTL_NET; mib[1] = AF_ROUTE;
Time of Update: 2018-12-05
參考[1] http://developer.apple.com/library/ios/#recipes/xcode_help-breakpoint_navigator/articles/about_breakpoint_navigator.html#//apple_ref/doc/uid/TP40010433-CH6-SW1偵錯工具時,斷點是必不可少的工具,下面介紹一下斷點具體使用1.普通斷點如所示,在xcode編輯框左側點擊 就出現一個斷點,右擊出現
Time of Update: 2018-12-05
參考:[1]http://www.apple.com.cn/developer/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AudioandVideoTechnologies/AudioandVideoTechnologies.html#//apple_ref/doc/uid/TP40007072-CH19-SW34[2]http://www.cocoachina.com/bbs/read.php
Time of Update: 2018-12-05
參考使用Quartz 2D 可以對圖片進行裁剪,簡單的可以裁剪一個矩形,複雜的可以根據CGPath實現裁剪,也可以使用UIBezierPath進行裁剪,也可以使用一個UIImage做為mask進行裁剪。對於如片,不使用裁剪時,顯示全部內容使用CGContextClipToRect裁剪矩形,UIImage* imageSrc = [UIImage imageNamed:@"island.png"];CGColorSpaceRef colorRef =
Time of Update: 2018-12-05
目前來看時間戳記是一個10位元(小數點之前) double類型的,如果是13位元,那麼需要除以1000#pragma mark -#pragma mark timeStringFromTimeInterval時間戳記-->時間- (NSString *)timeStringFromTimeInterval:(NSTimeInterval)timeInterval{ NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
Time of Update: 2018-12-05
參考[1]http://stackoverflow.com/questions/1877987/whats-the-difference-between-quartz-core-core-graphics-and-quartz-2d Quartz 2D 是Core Graphic 的一部分,Quartz是一組函數、資料類型以及對象,專門設計用於直接在記憶體中對視圖或映像進行繪製。The Quartz 2D API is part of the Core Graphics
Time of Update: 2018-12-05
Dear developer,We have discovered one or more issues with your recent delivery for "通訊小秘". To process your delivery, the following issues must be corrected:Corrupt Icon File - The icon file icon@2x.png appears to be corrupt.Once these issues have
Time of Update: 2018-12-05
+ (void)load;//class methods+ (void)initialize; //class methods- (id)init;這幾個方法的區別是什麼?:The class methods initialize and load give classes a chance to initialize themselves.NSObject構架協議與類· 包含協議:NSObject、NSCopying、NSMutableCopying、NSCoding·
Time of Update: 2018-12-05
想要永久儲存資料,我們當然可以使用plist檔案,當退出程式時,我們執行將資料寫入plist檔案的操作,使用writeToFile:atomically:方法。具有這個方法的類有:NSArrayNSMutableArrayNSDictionaryNSMutableDictionaryNSDataNSMutableDataNSStringNSMutableStringNSNumberNSDate例如,我們的資料存放區在NSArray的一個對象array中,儲存資料時執行:[array
Time of Update: 2018-12-05
NSTimer其實是將一個監聽加入的系統的RunLoop中去,當系統runloop到如何timer條件的迴圈時,會調用timer一次,當timer執行完,也就是回呼函數執行之後,timer會再一次的將自己加入到runloop中去繼續監聽。 CFRunLoopTimerRef 和 NSTimer這兩個類型是可以互換的,當我們在傳參數的時候,看到CFRunLoopTimerRef可以傳NSTimer的參數,增加強制轉化來避免編譯器的警告資訊指定(註冊)一個timer到 RunLoops中