Cub71
Cub71

Reputation: 323

ARC not working in iOS 4.3

I converted my project to using ARC and i works fine in iOS 5. But when running on the 4.3 simulator, i get a lot of these messages:

2011-10-16 12:23:29.915 iRoster[1604:1300b] * __NSAutoreleaseNoPool(): Object 0x5176e60 of class EKCalendar autoreleased with no pool in place - just leaking

I guess I could put a lot of @autoreleasepool around, but I had the impression that was optional. And the strange thing is that it only appears when running on 4.3

What should I do?

EDIT: I have now placed some @autoreleasepool around and that reduced the messages a lot, so that seems to be the case.

Upvotes: 1

Views: 1996

Answers (1)

BoltClock
BoltClock

Reputation: 723388

If you have your own autorelease pools within your application logic that you manage yourself pre-ARC, you need to replace them with @autoreleasepool constructs, and the compiler will deal with them accordingly.

Converting to ARC doesn't necessarily mean your existing autorelease pools are no longer needed — you'll still need individual pools to contain temporary autoreleased objects in, for example, loops in other threads, so they won't spend forever in memory and/or start leaking in those threads. See this Apple documentation on using autorelease pools.

Upvotes: 1

Related Questions