『iOS/Obj-C』Note Of 8-day Obj-C/iOS foundation course

来源:互联网 发布:如何利用网络招聘 编辑:程序博客网 时间:2024/04/26 05:42

Note Of 8-day Obj-C/iOS foundation course


1. rewrite method:init

- (instancetype)init{self = [super init];if (self) {//self.name = @"RainyTunes";}return self;}

2. nonatomic,atomic,assign,retain,copy

atomic -> with thread lock

nonatomic -> without thread lock

assign,retain,copy -> relate to Getter and Setter

3. Refering Counting(引用计数)

reference counting is a technique of storing the number of references, pointers, or handles to a resource such as an object, block of memory, disk space or other resource. 

It may also refer, more specifically, to a garbage collection algorithm that uses these reference counts to deallocate objects which are no longer referenced.


4. strong,weak

The difference is that an object will be deallocated as soon as there are no strong pointers to it. Even if weak pointers point to it, once the last strong pointer is gone, the object 

will be deallocated, and all remaining weak pointers will be zeroed out.


5. method: description

//definitely the sameNSLog(@"%@",[myStr description]);NSLog(@"%@",myStr);


6. Archive

Archive(归档)  = save = serialization


7. UIWindow

The UIWindow class defines an object known as a window that manages and coordinates the views an app displays on a device screen. Unless an app can display content on an external device screen, an app hasonly one window.


How to init a window:


The two principal functions of a window are to provide an area for displaying its views and to distribute events to the views. To change the content your app displays, you can change the window’s root view; you don’t create a new window. 

A window belongs to a level—typically, UIWindowLevelNormal—that represents where it sits on the z-axis relative to other windows. For example, a system alert window appears above normal app windows.


0 0
原创粉丝点击