Xcode Find and replace in all project files
45,469
Here are some pictures. In the toolbar search, you have to press 'Find' then a menu appears – pick replace. Now you can replace project-wide.
Related videos on Youtube
Author by
user426132
Updated on October 30, 2021Comments
-
user426132 over 2 years
I need to replace
NSLog
withDDLogVerbose
in all files in the current project I am working on… What is an easy method to do this? (the search navigator only has search in it).Also I need to add a line at the beginning of all .m files. How is this done quickly? (There are over 500 such files.)
-
Enrico Susatyo over 10 yearsI'm sure you can do this with cmd-shift-f and then selecting the replace mode?
-
Alladinian over 10 yearsClick on 'Find' (in the search navigator) and choose 'Replace' from the dropdown.
-
-
Tim Beaudet about 9 yearsI felt a bit silly when this wasn't working for me, but I found that after typing in the source of the replace I had to press enter for XCode to actually search through to find the matching strings. Otherwise the Replace / Replace All buttons remained disabled.
-
Nostradamus over 8 yearsThanks Tim - that MUST be a bug - I was trying to figure out why the search/replace button was still greyed out.
-
IceFire over 5 yearsare there shortcuts?
⌘3
opens find and search but can I also switch between find and replace? -
Carson Holzheimer over 3 yearsWow that UX :'(