IOS study notes, ios learning materials

Source: Internet
Author: User

IOS study notes, ios learning materials

1. the ios ui is first created with UiViewController to manage the UIView. Then, UIView is created, and different UI controls are created in each UIView.

2. Connection error. Terminating app due to uncaought exception 'nsknowkeyexception', reason: '[<ViewController> setValue: forUndefinedKey:]: this class is not key value coding

3. All attributes and method declarations should be placed in the class private extension of the ViewController. m file.

4. When the transform attribute is created using the CGAffineTransformMakeTranslation () method, the initial state is taken as the benchmark. Each parameter is equivalent to a re-assigned value, and only the initial state is used as the reference. You can use auto-increment or auto-increment variables as parameters or CGAffineTransformTranslate (). It uses the current transform as the parameter and then returns a new transform, which can be superimposed.

5. The rotation of transform is also effective only once using the CGAffineTransformMakeRotation () method. The same method is CGAffineTransformRotate ().

6. The same transform also has the zoom-in and zoom-out function, using the CGAffineTransformMakeScale and CGAffineTransformScale methods. The parameter is the ratio of x to y. The original ratio is 1.

7. copy: NSString; strong: general object; weak: UI control; assign: basic data type;

8. storyboard is used to describe the entire software interface, and xib is used to describe the local software interface.

9. The role of each field in the brackets of property
Assign: simple replication, does not change the index count (Reference Counting), corresponding to the basic data class
Copy: Create an object with an index count of 1, and then release the old object, corresponding to NSString
Retain: Release the old object, assign the object value to the input object, and increase the index count of the input object to 1, corresponding to other NSObject and its subclass.
Difference between weak and strong: when an object does not have a strong pointer pointing to it, it will be released even if a weak Pointer Points to it. Once the last strong pointer leaves, all the remaining weak pointers will be cleared.
The difference between copy and strong: 1. copy creates the same object, but retain is not. 2. copy is content copy, and retain is Pointer copy. 3. copy is a copy of the content. This is true for NSString. However, if it is NSArray, it only copies the pointer to the elements in the array, that is, "shortest copy ".
Atomic and nonatomic: atomic is a thread protection technology that prevents reading by another thread when writing is not completed. If no multithreading is used, nonatomic can be enabled.

10. Add the minus sign before the method ????

11. xcode custom code snippet @ property (nonatomic, retain) <# type #> * <# name #>;
Select the Code we just entered and drag it to the Code Snippets Library.
Scroll to the bottom of the Code Snippets Library and find an icon with the "User" text on it.
Click the icon to bring up a window. Click the Edit button on the left at the bottom of the window.
In Title and Completionshortcut, enter the Title and shortcut key of the code snippet. The shortcut key is used to activate the code prompt. The title is displayed in the code prompt. In this example, we enter the title "Objective-C @ property retain" and the shortcut key is "@ property ".
Select the corresponding platform, language, and Completion scope. Click "Done.
In this example, we select "All" for "platform", "Objective-C" for "language", and "Completion scope" for "Class Interface Methods.
Completion scope specifies a valid region for activating the code prompt. For example, the Class Interface Methods we selected here indicates that the Code shortcut key can activate the code prompt only in the declared Class method area; no matter how you press this shortcut key in any other area, this code will not be prompted.

12. Implementation of ScrollView Proxy: 1. Implement the UIScrollViewDelegate protocol in a class. 2. This class can implement the optional method in the proxy. 3. Set ScrollView. delegate = Class.
Benefit: it allows A listener object A to change the state of object B, which is equivalent to A notification object A to change the state of object B.

13. OSI Layer-7 model: physical layer, data link layer, network layer, transmission layer, Session Layer, presentation layer, and Application Layer
TCP/IP layer-4 model: Host-to-network layer, network connection layer, transport layer, and Application Layer

14. UiTableView can directly set the rowHeight attribute to set a uniform row height.
Using the delegate Protocol to implement the heightForRowAtIndexPath method, you can set the row height for the row number.

15. UITableView memory problems occur when numberOfRowsInSection is used, because this method is called when the cell enters the display range of the screen. If an object enters the display range multiple times, this method will open up space for the Data Multiple times. Although the cell that leaves the screen range will be automatically destroyed, the cpu pressure will be given when the data is constantly created and destroyed. The correct method should be to find available cells in the buffer pool that comes with UITableView when creating an object. If no available cells are found, open up the space. If yes, overwrite the properties, when creating and searching, You Need To reuseIdentifier to identify different cells. The method you are looking for is the UITableView built-in method dequeueReuseableCellWithIdentifier:

-------------------------------------- Manual split line -----------------------------------------

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.