Time of Update: 2015-07-25
Objective-C知識總結(2),objective-c知識總結每一個執行個體變數定義兩個方法:設定變數的setter方法 擷取變數值的getter方法set方法的書寫規範get方法的書寫規範下面示範set和get方法的代碼我們建立一個Person類在.h檔案中的代碼如下:#import <Foundation/Foundation.h>@interface Person : NSObject{ NSString *_name; int _age;}//
Time of Update: 2015-07-25
GCD-使用方法,sumif函數的使用方法代碼: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ //在後台進行網址的解析操作 NSURL * url = [NSURL
Time of Update: 2015-07-24
iOS開發之使用Runtime給Model類賦值,iosmodel 本篇部落格算是給網路緩衝打個基礎吧,本篇部落格先給出簡單也是最容易使用的把字典轉成實體類的方法,然後在給出如何使用Runtime來給Model實體類賦值。本篇部落格會介紹一部分,主要是字典的key與Model的屬性名稱相同時,使用Runtime來進行賦值,下篇部落格會給出字典key的值和Model的名字不同時的解決方案,並給出使用Runtime列印實體類屬性值的方式。 iOS開發中的Runtime可謂是功能強大,同時Runt
Time of Update: 2015-07-25
iOS單例銷毀 1 單例的實現見之前寫過的一篇文章 iOS單例的快速實現 static InstanceClass *instance; + (InstanceClass *)defaultInstance{ @synchronized (self){
Time of Update: 2015-07-24
storyboard,storyboard教程一,代碼動態改寫1,一般程式啟動就自動執行 main.storyboard也可以在AppDelegate改寫- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[[UIWindow alloc]
Time of Update: 2015-07-24
iOS 倒計時NSTimer項目中可能會遇到有些倒計時的地方比如 手機驗證的時候,驗證碼一般都會有一個時間限制,此時在輸入驗證碼的地方就需要展示一個倒計時 具體實現方式是使用了iOS 內建的 NSTimer 上代碼首先建立 int secondsCountDown; //倒計時總時間長度 NSTimer *countDownTimer; UILabel *labelText; 然後具體實現 //
Time of Update: 2015-07-24
Objective-C知識總結(1),objective-c知識總結Objective-C簡稱OC,是一款可以開發Mac OS
Time of Update: 2015-07-24
iOS 階段學習第25天筆記(iOS沙箱機制介紹),ios沙箱iOS學習(OC語言)知識點整理一、iOS沙箱機制介紹 1)概念:每個ios應用都有自己的應用沙箱,應用沙箱就是檔案系統目錄,與其他應用放入檔案 系統隔離,ios系統不允許訪問
Time of Update: 2015-07-24
ios NSScanner 掃描字串擷取相應的需要的字串例如從一段字串中提取出數字-(int)findNumFromStr{NSString *originalString = @a1b2c3d4e5f6g7h8i9j;// IntermediateNSMutableString *numberString = [[[NSMutableString alloc] init] autorelease];NSString *tempStr;NSScanner *scanner =
Time of Update: 2015-07-24
GCD-block-後台運行,gcd-block-後台當一個app按home鍵退出的時候,只有最多5秒的時間做一些儲存或清理資源的工作。但是調用beginBackgroundTaskWithExpirationHandler方法,可以最多有10分時間在後台運行。我們可以用這個時間來做清理本機快取,發送統計資料等事情。 AppDelegate.h #import <UIKit/UIKit.h>@interface AppDelegate : UIResponder
Time of Update: 2015-07-23
記憶體分區,c記憶體分區記憶體有五大地區從高地址到低地址分別為:棧、堆、BBS段、資料區段、程式碼片段提示:棧和堆是運行時分配,BBS段、資料區段、程式碼片段是編譯器分配BBS段:通常是指用來存放程式中未初始化的全域變數和靜態變數資料區段:通常是指用來存放程式中已經初始化的全域變數和靜態變數、字串常量等程式碼片段:通常是指用來存放程式執行代碼的一塊記憶體地區堆:是用於存放進程運行中被動態分配的記憶體段(調用malloc函數,新分配的記憶體動態添加到堆上;調用free函數,釋放記憶體從堆中刪除)棧
Time of Update: 2015-07-24
iOS_網路請求_代理方式#pragma mark - 網路請求代理方式(非同步)- (IBAction)DelegateButtonDidClicked:(UIButton *)sender { // 1、拼接 urlString,網址裡面必須寫 http:// NSString *urlString = @http://ipad-bjwb.bjd.com.cn/DigitalPublication/publish/Handler/APINewsList.ashx?date=201
Time of Update: 2015-07-24
iOS swift使用xib繪製UIView目標:用xib繪製一個UIView,在某個ViewController中調用。三個檔案:ViewController.swift DemoView.swift DemoView.xib 首先,可以專心將DemoView.xib畫出來,別忘記DemoView.xib中UIView的一處設定 然後,寫DemoView.swift檔案,代碼如下: class CoreView: UIView { //MARK: //
Time of Update: 2015-07-24
iOS_POST_網路請求同步的 post 請求#pragma mark - 同步的 post 請求- (IBAction)POSTSynButtonDidClicked:(UIButton *)sender { // 1、拼接 baseUrlString NSString *baseUrlString = @http://ipad-bjwb.bjd.com.cn/DigitalPublication/publish/Handler/APINewsList.ashx; // 2
Time of Update: 2015-07-23
static 和 extern,staticexternstatic 和 extern 修飾局部變數static修飾局部變數: 作用:1)static定義的變數的範圍會得到延長 2) static定義變數的語句只會被執行一次 extern不能夠修飾局部變數的void test (int num){ static int n = 0; printf("%d",n);
Time of Update: 2015-07-23
ios開發之-計算機的改進#import extern double add(double x,double y);extern double subtract(double x,double y);extern double multiply(double x,double y);extern double divide(double x,double y);#import #import MathOperation.hBOOL isAnOperator(const char value){
Time of Update: 2015-07-23
iOS_GET_網路請求同步的 get 請求#pragma mark - 同步的 get 請求- (IBAction)GETSynButtonDidClicked:(UIButton *)sender { // 1、網址裡面必須寫 http:// NSString *urlString =
Time of Update: 2015-07-23
自己實現蘋果安裝app動畫,蘋果app動畫最近在學習CALayer相關動畫,然後某一天突然發現蘋果安裝app這動畫就很不錯啊,所以就想自己實現下。具體效果還是不試不知道一試嚇一跳啊,這看上去簡單的動畫沒我想象的那麼簡單。首先這個動畫分兩步:一是中間的圓像時鐘一樣走一圈;二是外面的大圓變大到包括整個圖片的大小; 首先是第一步:這時候大圓外部跟小圓內部都是半透明的,小圓走過的部分會變成透明。一開始我一直想用mask的方式來實現,結果試了老好久還是不行,就扔那兒了。過了兩天再看它,發現其實自
Time of Update: 2015-07-23
GCD-block,adblock一,block的定義 //申明變數(void)(^PrintStr)(void);//定義PrintStr=^{ NSLog(@"PrintStr");};//調用PrintStr(); 二,修改block之外的變數 block程式塊中的變數不對程式塊外生效,可以加上_block讓其生效。 int a=0;void (^foo)(void)=^{ a=1;}//foo()
Time of Update: 2015-07-23
IOS - 設定與協助介面設定與協助修改頭像, 修改密碼, 移動客服, 協助, 聲明, 關於我們.代碼//// IndexSetting600ViewController.h// SymptomChecker//// Created by wang on 2015-7-21.////#import CYTableViewController.h@interface IndexSetting600ViewController : CYTableViewController@end////