1

I just went over to the ARC in my iPhone/iPad app and it works great, but I have this code in the files that are shared with other projects #if !__has_feature(objc_arc).

For example:

- (void)viewDidUnload {
#if !__has_feature(objc_arc)
    [logInView release];
#endif

    logInView = nil;
}

And my question is: Can I remove all this code by any search function in XCode or must I do it for hand?

Thanks!

Gustaf Rosenblad
  • 1,902
  • 2
  • 25
  • 45

2 Answers2

0

Yeah you can, Highlight what you want to change and click refactor -> rename. In the rename view, you can change it to whatever you like.

Here

This question is a duplicate of this. A google search can be your best friend :)

Community
  • 1
  • 1
LAMBORGHINI
  • 338
  • 2
  • 13
0

you could regex with something like:

#[\s]*if[\s]*!__has_feature\(objc_arc\)[\s\S]*?(#[\s]*endif)

if you include any more space in there, then you would want to add symbols for those, I accounted for :

#    if
#    endif

but not

 __has_feature (  objc_arc  )
Grady Player
  • 14,399
  • 2
  • 48
  • 76