Skip to content
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

PBXReferenceProxy missing display_name attribute. #472

Closed
barakwei opened this issue Mar 22, 2017 · 1 comment · Fixed by #473
Closed

PBXReferenceProxy missing display_name attribute. #472

barakwei opened this issue Mar 22, 2017 · 1 comment · Fixed by #473

Comments

@barakwei
Copy link
Contributor

barakwei commented Mar 22, 2017

Hello
I noticed that if I open my project and immediately save it without changing anything, the project file was always changes. All the lines like

0D492AD61E6D924B00A313DB /* SDWebImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D492AC71E6D91B300A313DB /* SDWebImage.framework */; };

Changed to

0D492AD61E6D924B00A313DB /* ReferenceProxy in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D492AC71E6D91B300A313DB /* SDWebImage.framework */; };

I look like in build_file.rb#L45 it calls the ref display_name which is not implemented there so it fails over to the base implementation, and since name doesn't exist, ReferenceProxy is returned.
I believe adding display_name to PBXReferenceProxy that returns path if name doesn't exist should fix it.

I solved it by opening the class in my code:

module Xcodeproj
  class Project
    module Object
      class PBXReferenceProxy
        def display_name
          return name if name
          return path if path
          super
        end
      end
    end
  end
end
@segiddins
Copy link
Member

Thanks for the issue! The fix you suggest sounds correct

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

Successfully merging a pull request may close this issue.

2 participants