XcodeEditor
XcodeEditor copied to clipboard
how can i remove an existing xxx.framework(not imported from apple's libraries) from my project
my project AAA.xcodeproj contains bbb.framework which is added to ccc.target. and i want to remove bbb.framework how can i make it
i tried this:
XCProject *asProject = [[XCProject alloc] initWithFilePath:@"/Users/xxx/Desktop/project/test/testXCodeConfig/AAA.xcodeproj"];
XCTarget *aTarget = [asProject targetWithName:@"ccc"];
XCSourceFile *file = [asProject fileWithName:@"bbb.framework"];
NSLog(@"%d",originTarget.members.count);
[aTarget removeMemberWithKey:file.key];
NSLog(@"%d",aTarget.members.count);
[asProject save];
but it didnt work.
1.Find your framework group 2.Use XCGroup memberWithDisplayName function 3.target removeMemberWithKey:file.key
Actually, i made it a couple days after i post this issue.
But i got this issue on the very condition that i duplicate my target. So this is still a bug, when i duplicate a target and i will fail to remove a source file on the original target.
Yes, duplicate a target have some bug,So i remove file first, and then duplicate target.......