When I first learned Objective-C, I felt that there were many unfamiliar and strange syntax and features. For example, syntax such as NSObject *obj = [[NSObject alloc] init];; for example, trying to call a function with a null pointer will not cause a crash. It wasn’t until I had the opportunity to learn more about […]
Tag: objective-c
[Objective-C] A brief analysis of Block and its capture mechanism
Directory Basic use of Block Block’s statement Implementation of Block Block call Block is used as a formal parameter Block is used as an attribute Give the Block an alias Block copy Block capture mechanism local variables of type auto Brief analysis of __block static type local variables global variables other problems Basic use of […]
[Objective-C] Reference counting
1. Basic concepts: As the name suggests, Automatic Reference Counting (ARC) refers to the technology of automatically counting references in memory management. The following is excerpted from Apple’s official description: The Automatic ReferenceCounting (ARC) mechanism is used in Objective-C to let the compiler perform memory management. Setting ARC to a valid state in the new […]
NetworkMoyaBase objective-c and swift common network packaging library
Overall description The network encapsulation library implemented through Moya and Alamofire adapts to business calls that support objective-c projects and complete swift projects. The data returned by the network is JSON parsed through swiftyJSON, and the oc data structure of the data is implemented through HandyJSON and YYModel respectively. Conversion and conversion of swift data […]
use gnustep objective-c
first app #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) {<!– –> NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSLog(@”first start”); [pool drain]; return 0; } tech Focus on concepts instead of getting lost in language technical details The purpose of a programming language is to become a better programmer; that is, to become more effective […]
Objective-C mix UITabBar and UINavigation
Tip: After the article is written, the table of contents can be automatically generated. How to generate it can refer to the help document on the right Article Directory foreword 1. What is pandas? 2. Use steps 1. Import library 2. Read data Summarize Foreword Mix UITabBar and UINavigation for app, tab and nav, sometimes […]
Custom section registers Objective-C class objects
Background If you want to store a specific service class in the custom section and realize the inversion of control of the service, the common practice is to define a string pointer pointing to the class name of the target class, and use the runtime method to obtain the target kind. A simple example is […]
[Objective-C] Serious People Today – Classes vs Extensions vs Protocols
[Objective-C] Serious People Today – Classes & Extensions & Protocols Article directory [Objective-C] Serious People Today – Classes vs Extensions vs Protocols Classes and Extensions How to define a category to add methods Calling a private method by forward reference The extension is equivalent to defining an anonymous class Agreement and commission Informal and formal […]
[Objective-C] What tauren – turn the basic type into an object and then do it
[Objective-C]What kind of tauren – turn the basic type into an object and then do it Article directory [Objective-C] What tauren – turn the basic type into an object and then do it become an object Packaging NSValue wrapper class NSNumber Wrapper Class basic type NSInteger type NSUInteger type CGFloat type processing object print object […]
[Objective-C] Classes and objects (below) 1.0
6.1 Objective-C class packaging 1. Class packaging Objective-C is extended from C language, and C language including basic data types (int, float) are not objects, they do not have the characteristics of objects – no properties, methods can be called. Objective-C provides NSValue, NSNumber to encapsulate the basic types of C language, making them object-oriented. […]