Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

converting an non ARC project to ARC

I have an Xcode 3.2 targeted project . I want to convert this project to ARC to improve the

performance.I am following these steps.

Edit->Refactor->Convert to Objective C ARC

I have got some .mm files to which I am disabling the ARC using -fno-objc-arc. But even after

this I am getting lot of errors (ARC issues). For eg mainly in self=[super init]call,the

error is cannot assign to self outside of a method in the init family. Can

anyone tell me am I following the correct steps ?

like image 822
Raj Avatar asked Sep 17 '12 06:09

Raj


1 Answers

I was trying to convert a projet to ARC and after creating a new one and including the files from the old one - one of the issues i got was

Cannot assign to 'self' outside of a method in the init family

The selector name MUST begin with init - not only that - in my case the init selector was:

-(id)initwithPage:(unsigned)pageNum {...}

Notice the small 'w'.

I have changed it to:

-(id)initWithPage:(unsigned)pageNum {...}

Notice the capital 'W'!

My problem was solved.

I hope this helps someone.

like image 189
Sasho Avatar answered Sep 28 '22 02:09

Sasho