New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Remove file by file reference in project #132

Closed
lolgear opened this Issue Mar 6, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@lolgear

lolgear commented Mar 6, 2014

I didn't find any method for operation "remove file".

Could you add it or point at an existing function?

@alloy alloy closed this Mar 6, 2014

@lolgear

This comment has been minimized.

Show comment
Hide comment
@lolgear

lolgear Mar 6, 2014

I can't understand how to use them.
I found a 'remove_from_project' object's function, but If I try to use it on '.m' file, I catch error:
can't remove file, because PBXBuildFile reference to it.

lolgear commented Mar 6, 2014

I can't understand how to use them.
I found a 'remove_from_project' object's function, but If I try to use it on '.m' file, I catch error:
can't remove file, because PBXBuildFile reference to it.

@lolgear

This comment has been minimized.

Show comment
Hide comment
@lolgear

lolgear Mar 6, 2014

I try to use something like this:

'open xcode project
xcodeproj_object = Xcodeproj::Project.open(path_to_project)

'find files that I want to remove and put them in array:

files_to_be_removed = ... # Array

files_to_be_removed.each{ |file|
xcodeproj_object.files.delete(file)
'or file.remove_from_project() - fails on .m file type
}

lolgear commented Mar 6, 2014

I try to use something like this:

'open xcode project
xcodeproj_object = Xcodeproj::Project.open(path_to_project)

'find files that I want to remove and put them in array:

files_to_be_removed = ... # Array

files_to_be_removed.each{ |file|
xcodeproj_object.files.delete(file)
'or file.remove_from_project() - fails on .m file type
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment