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

nib2cib fails to convert xibs with target set later than macOS 10.12 #3043

Open
enquora opened this issue Jun 2, 2022 · 6 comments
Open
Assignees
Labels
Milestone

Comments

@enquora
Copy link
Contributor

enquora commented Jun 2, 2022

nib2cib fails to convert any xibs for which the "Builds for" property (in the xib Identity inspector) is set more recent than macOS 10.12.

A diff of the XML for otherwise identical xib files indicates the only difference is the line:

  • macOS 10.12 (succeeds): <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
  • macOS 10.12.2 (fails): <autoresizingMask key="autoresizingMask"/>

We need to handle the absence of the widthSizable and heightSizable properties.

@cappbot cappbot added this to the Someday milestone Jun 2, 2022
@cappbot cappbot added the #new label Jun 2, 2022
@cappbot
Copy link

cappbot commented Jun 2, 2022

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

@enquora
Copy link
Contributor Author

enquora commented Jun 2, 2022

Needs a proper reduction with specific xib examples

@michaelbach
Copy link
Contributor

michaelbach commented Jun 3, 2022 via email

@enquora
Copy link
Contributor Author

enquora commented Jun 3, 2022

It simultaneously simpler and more complex.
Here is the diff between two xibs with identical content — a single, empty window:

VersionTest 10.12.xib | VersionTest. 12.0xib – 1 Deletion.pdf

It appears the problem is with ibtool refusing to convert if the <deployment version> tag is not present.
Will need to see what the actual output from ibtool is.

Test Xibs.zip

@enquora
Copy link
Contributor Author

enquora commented Jun 4, 2022

It appears that plutil --compile is where the problem occurs

Property List error: Unexpected character N at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0.
Immediate thoughts are that we should check the target version of the xib and report incompatible versions.

Likely simple for nib2cib itself, much less so for XcodeCapp when it runs nib2cib.
Starting to wonder, again, if writing our own xib transformer would be simpler.
Xibs are just XML, after all — I wonder if XSLT wouldn't do what we need.

@enquora enquora self-assigned this Dec 21, 2023
@cappbot
Copy link

cappbot commented Dec 21, 2023

Assignee: enquora. Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

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

No branches or pull requests

3 participants