iOS Learning notes----15/09/06

Source: Internet
Author: User

When the 1.prepareForSegue is in progress, all view of the target controller has not yet been created, and it is not valid to operate on the object in the Viewdidloa method, so the required assignment should be implemented.

2. Modify the data in the table, if jump to the next page when the transfer of the direct assignment, pass the pointer, in another page after the completion of the modification of the page, the direct reloadtable to achieve the effect of the modification.

3.TableViewCell if created by storyboard or Xib, the method at the beginning of Init is not called (Initwithcoder is a special case) and only awakefromnib is called.

The frame that was obtained in 4.awakeFromNib is the frame that was created when the creation was completed, that is, the default frame, and the child control frame should be set inside the Layoutsubviews method.

5.plist file storage in five steps:

    1. Get the current working directory (sandbox directory) by calling the C-language function nshomedirectory ().
    2. The path to the folder needs to be pieced together by the stringByAppendingPathComponent method of the string.
    3. Once again, use the method in the second step to stitch up the specific path where the plist file is stored.
    4. Creates an object of type nsarray,nsnumber,nsdictionary,nsdata,nsstring.
    5. Call the method WriteToFile method that created the object.

6. If the file is read, there is no 5th step, and the fourth step is replaced with Arraywithcontentoffile.

7. You can use Nsuserdefaults to store it in a way similar to a key-value pair, where the deposit value is the method that starts with set, and the read is the method that begins with the data type. Use the class method standarduserdefaults when creating objects.

8. The disadvantage of the two plist storage methods is that you cannot store custom classes.

9. Document Reading and archiving

    1. First, implement the Encodewithcoder (archive) or Initwithcoder (read) method in the target class;
    2. Then declare a nskeyedarchiver (archive) or nskeyedunarchiver (read file) class.
    3. Use Archiverootobject:tofile: (archive) or unarchiveobjectwithfile: (read) method for data archiving or file reading.

10. If the subclass is a read archive, be sure to override the two related methods of the parent class and invoke the parent class's method when overriding.

To die upgrade win10, used to rollback Win7 found infinite recovery in .... It's a waste of time to reload.

iOS Learning notes----15/09/06

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.