OBJECTIVE-C----Autorelease Pool

Source: Internet
Author: User
Autorelease Pool Usage Precautions:
  1. Under ARC, you cannot use [[NSAutoreleasePool alloc] init], but you should use @autoreleasepool;
  2. Do not put a large number of cyclic operations between the same nsautoreleasepool, which will cause memory spikes in the rise;
  3. Try to avoid using this method for large memory, or use it sparingly for this delayed release mechanism;
  4. The objects created and returned by the general static method in the SDK are autorelease and do not require release operations; for example: [NSNumber numberwithint:10]; The returned object does not need to be re-release, but the object created by [[NSNumber Alloc] initwithint:10] needs to be release;
  5. Any variable defined in curly braces cannot be used outside of parentheses. This is the typical C language of the effective range, such as loop code.

OBJECTIVE-C----Autorelease Pool

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.