سؤال

I am following a youtube video about CSV data access. But I have seen in the framework that NSAutoreleasePool is specified as obsolete. Have we got another way to develop access to CSV data file?

هل كانت مفيدة؟

المحلول

@autoreleasepool {
   // parse your CSV
}

نصائح أخرى

The "brackets" pool = [[NSAutoreleasePool alloc] init] and [pool drain]; have been replaced with @autoreleasepool { <stuff between the "brackets> }.

@autoreleasepool is not at all obsolete in iOS5++. In some cases you MUST set up your own autorelease pool, see the docs.
The most important cases are 1) if you have code that creates many temporary objects that could be released before the app returns to the main run loop (you should), and 2) if you setup a separate thread (you must).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top