3

I just downloaded an Xcode project, and I get all these errors about "ARC Restrictions." What are these, and how can I remove them?

neuromancer
  • 53,769
  • 78
  • 166
  • 223

2 Answers2

4

There are basically two versions of memory management in objective-c. ARC and... well, "Not ARC" :-) You probably downloaded a project, which doesn't use ARC already. Simplest way of resolving your problem is to instruct the compiler to treat your sources as "Not ARC". Explained here.

And here is a good tutorial that should get you started with ARC.

Community
  • 1
  • 1
Andy Friese
  • 6,349
  • 3
  • 20
  • 17
3

ARC automatically keep track of memory release and retain so you can not release and retain any memory manually.

ARC also doesn't allow any method to be get called at compile time which prototype is not declared in interfaces.

It has also introduced new @autoreleasepool block. so it doesn't not allow older autorelease of an object automatically

However it has allowed dealloc method to be written, but it doesn't allowed [super dealloc] to be get called.

There are much more written about ARC at this blog you can checkt it here

You can covert your project to ARC using xcode in following way. Go to Edit -> Refactor -> Convert to objective c arc.

However it has some compatibility issue with git repository so it does not convert when .git folders are there in projects. so you will have to remove it first and then convert it. check this link

Sunil Pandey
  • 7,042
  • 7
  • 35
  • 48