原创 HTTP和TCP協議,三次握手四次揮手

一、HTTP是什麼 http(HyperText Transfer Protocol),超文本傳輸協議,是互聯網上最廣泛的一種網絡傳輸協議,所有www文件都必須遵守的一個標準,是以ASCII碼傳輸,建立在TCP/IP協議上的應用層

原创 KVO實現原理和代碼實現

鍵值觀察通知依賴於NSObject兩個方法:willChangeValueForKey:和didChangeValueForKey:在一個被觀察屬性發生改變之前,willChangeValueForKey:一定會被調用,這就會記錄

原创 LeetCode(一)求兩個數之和( Two Sum)--------(OC版本)

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assum

原创 Category、load、initialize

根據runtime的消息發送機制,核心函數void objc_msgSend(void /* id self, SEL op, … */ )發送消息,先從當先類的方法列表中查找調用方法,如果沒有找到,則會向上尋找其父類中的方法列表

原创 nil、Nil 、NULL、NSNull

nil:指向Objective C語言中對象的空指針,其定義值爲(id)0。 Nil:指向Objective C語言中類的空指針,其定義爲(Class)0. NULL:指向c語言中標準的空指針,其定義爲(void*)0. NSNu

原创 iOS的消息轉發機制

OC由於運行時特性,可以在運行期間動態添加方法,這個尋找動態添加的方法的過程就是動態消息轉發。 iOS的消息轉發機制分爲三個步驟:動態方法解析、快速消息轉發機制、標準消息轉發機制  (一)動態方法解析 首先是徵詢接收者所屬的類

原创 事件傳遞和響應機制

蘋果文檔 https://developer.apple.com/documentation/uikit?language=objc (一)事件傳遞過程 蘋果註冊了一個source1(基於mach port)用來接收系統事件,其回

原创 RunLoop

1. 簡介 RunLoop可以理解爲一個do-while循環: function loop(){ initialize(); do{ event = getEvent(); HandleEvent(event);

原创 NSTimer循環引用

+ (NSTimer *)timerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(nullable

原创 LeetCode(三)無重複字符的最長子串(Longest Substring Without Repeatinng Characters )--------(OC版本)

Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Out

原创 LeetCode第一題求兩個數之和( Two Sum)--------(OC版本)

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assum

原创 Flutter入門——————開發環境搭建

(一)首先下載解壓Flutter SDK  https://storage.googleapis.com/flutter_infra/releases/stable/macos/flutter_macos_v1.0.0-stable.zi

原创 AppDelegate 內的方法在APP生命週期觸發的時機和順序

首先介紹一下各個方法觸發的時機 - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOpt

原创 去APP Store評分撰寫評論方案

(一)       跳轉APP Store的方式,在APP Store應用內進行評分 實現方式: 以[[UIApplicationsharedApplication] openURL:url的方式去評分 iOS 7.0 以後 的url :

原创 合併真機和模擬器的framework的可執行文件

lipo -info 可執行文件的路徑 查看信息 lipo -create  真機framework的可執行文件的路徑  模擬器framework的可執行文件的路徑 -output  真機framework的可執行文件的路徑 這樣就輕鬆的