The file is not under version control - xcode

I'm using a Git. When I add a file and check "Copy items into destination group's folder (if needed)" this error occurs:

Try adding it to your project folder and then drag-and-drop to the project in Xcode.
If it still doesn't work you can just create a new file in the project itself, call it the same as the file you are trying to copy and then copy-paste all the code.
Hope it helps

Just delete the file reference from the XCode. Make sure not move file to trash. Then add the file again by drag and drop or by Add file to project option. Now the file will be under source control.

Related

Xcode add reference to files instead of copy

I have created my framework that i want to add in my project. What i do is:
In my project i chose Xcode -> File -> Add Files to..
In prompt window i go for framework directory, chose .xcodeproj file
Check "Copy items if needed" and "Added folders - Create groups" radio button
What i expect - .xcodeproj that contain my framework is added and copied to my project
What i got - i can see file in Xcode, but not in folder when my app exist. So, when i try to Delete -> Move to trash my framework, it delete it in folder when it was created (not my project folder).
I can't figure out how to actually add and copy file instead of reference to it.

Renaming the folder which contains my .csproj file

so I’ve been trying to rename a old project that I had been working on but every time I rename the folder that contains my csproj it won’t load and asks to load the the file with the folder name
My old project was Metroloader/Metroloader.csproj
The thing I want to change it to is Nutsloader/Nutsloader.csproj
Close Solution
Rename folder
Open solution
Remove not loaded project from solution
Add existing project from new location:
You need to edit .sln file and provide correct folder path to your renamed .csproj

Finding hidden images in xcode?

I am trying to change image name , and i get :
The file could not be renamed because a file with that name already exists
I CANT find that image in there,(project assets) it was deleted.
How can i be sure that its not in there ?
Thanks.
Xcode shows what's in the project, not what's in the project's folder.
Open the folder of the file you want to rename (right click on the file in Xcode -> Show in Finder), and you'll probably see another file with the name you were trying to rename to. Remove that other file (if you're sure you don't need it).
What I would do move forward is get out of the IDE:
Remove the file from Xcode, but not the filesystem, by "Deleting" the file and selecting "Delete Reference Only"
Rename the file in the filesystem(finder or terminal)
Re-add it to the project file.
Caveat: Confirm you aren't renaming the file with the same name, but with only a case change, that gets a little weird, mostly with SCM tools, but also OSX filesystems are case-insensitve by default, so File.m and file.m are the same file.

Xcode - Dealing with folders by code

When you add a folder that contain subfolders and files to the Xcode project, the Xcode ask you about the folder option:
Create groups for any added folders.
Create folder references for any added folders.
I want to download the folder from a server. When the download is complete, the folder option will be 1 or 2? How can I set the folder option to option 2?
When Xcode references a folder, it uses whatever files are stored at that location on your local disk. If you download a new file to that folder or copy a file into that folder, it will show up in your Xcode project. If you change a file in that folder (by overwriting it in the Finder, or by using another app to download another copy of the file over the existing one), Xcode will use the new one.

How can I remove files from a QtCreator project

Might be a very newbie question, but I can't find a way to remove files from my projects in QtCreator. Thanks!
If your project is generated from CMake, the file list is determined by the CMakeLists.txt file, and you cannot add or remove files manually from the source tree in QtCreator. Especially if your CMakeLists file specifies the glob operator for a project's file list, you must manually remove the files from disk and re-run CMake from within QtCreator by going to Build->Run CMake (QtCreator 3.3.0). This will update the file list but also regenerate the project (cbp) file - re-running CMake outside of QtCreator will not update the project file and you will have ghost entries of deleted files showing up in the source tree if you deleted them from disk.
Right-click the file you want to remove, and choose "Remove File..."
Checking the "Delete file permanently" check box will delete the file, otherwise it will just be removed from the project.
Find your project file .pro in qt creator or other text editor
Find the file/folder name you want to remove in the .pro file
Delete all the files you want to remove
save and close the project
Reload the project
DONE
Could not find one-touch action as in Eclipse to delete a class:
1) Press right click on the file/class, and then choose "remove file..."; (u can tick "permanently" to remove from HDD if you like).
2) Do it to .CPP and .H files.
3) Then check in your .pro file the class are not there anymore.
Note: Some compilers will keep searching for this file/class in compilation. Just delete the compilation directory and compile again.
If you mess up like me and accidentally add a lot of files to the qml.qrc, it might help to know that these are listed in the actual qml.qrc file which you can edit to remove these files.
I also run into this problem.
I wanted to remove a header file.
But remove action in context menu was disabled I didn't know why.
The file name was qtextdocument.h.
I wanted to change the name to textdocument.h.
I tried to do various ways, but the filename was strictly fixed.
My removal procedure was as follows:
I dare to add an empty file to the file directory (in header file directory).
Anyway, I set the file name as textdocument.h when Qt Creator asked me to set the filename.
A confirmation warning popped up.
(Qt Creator cannot add the file automatically, we must add the file name to CMakeTextLists.txt)
I changed the filename in CMakeTextLists.txt from 'qtextdocument.h' to 'textdocument.h' in the row of set(PROJECT_SOURCES).
Finally, the update was confirmed. 'qtextdocument.h' was removed and the name is changed to 'textdocument.h'.
If you only want to remove a file, only you have to do is to delete the filename when you are in step 3.
After updating the project tree, the actual file is in your computer.
If you want to delete the file completely, you select file system and remove the file, not from project.
I don't know why, but in the case of filesystem mode, remove action is enabled.
So I might & should have told you that you select "filesystem mode" and remove the file at the first time...
(Sorry I have found out this fact later.)
Both of the two ways, I think we must rewrite the contents of CMakeTextLists.txt.
I also run into the case , the update removed the filename as soon as I deleted the filename from CMakeTextLists.txt.
I believe this case I directly make a file in the actual directory. On the contrary, above case is the files are added from Project menus.
go directly delete the project folder from your hdd.
For Linux, edit ~/.config/QtProject/QtCreator.ini
Under [ProjectExplorer], delete the project name and its corresponding configuration file from the following two lists:
RecentProjects\DisplayNames
RecentProjects\FileNames
e.g., given the following
RecentProjects\DisplayNames=proj1, proj2, proj3
RecentProjects\FileNames=<proj1_dir>/CMakeLists.txt, <proj2_dir>/proj2.pro, <proj3_dir>/proj3.pro
to delete proj1 from the qtcreator startup page, edit the above two lists as
RecentProjects\DisplayNames=proj2, proj3
RecentProjects\FileNames=<proj2_dir>/proj2.pro, <proj3_dir>/proj3.pro

Resources