SAP DEV
SAP DEV

Reputation: 111

iOS; NSAutoreleasePool is obsolete?

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?

Upvotes: 0

Views: 889

Answers (3)

QED
QED

Reputation: 9913

@autoreleasepool {
   // parse your CSV
}

Upvotes: 5

Hot Licks
Hot Licks

Reputation: 47699

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

Upvotes: 4

Reinhard M&#228;nner
Reinhard M&#228;nner

Reputation: 15217

@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).

Upvotes: 1

Related Questions