JSTalk Editor and Xcode 5

58 views
Skip to first unread message

Alan W

unread,
Oct 21, 2013, 4:20:24 PM10/21/13
to jstal...@googlegroups.com
It turns out that the Xcode 5 xib format has some strangeness with the JSTalk Editor, in order to not have it insert 'Smart Quotes' and break the scripts, you will need to edit the JSDocument.xib so that it re-saves it.

Just selecting, and then unselecting the "Smart Quotes" property, for example, and saving is enough to fix the problem.

It looks like it's because xc5 IB does something really funky when loading the xib that it's not telling you about. The git diff claims it's changing a bunch of keys like automaticQuoteSubstitutionEnabled to 0 from 1, but searching for those keys in the original git repo turns up no results.

Good times.

Peter N Lewis

unread,
Oct 31, 2013, 9:24:43 AM10/31/13
to jstal...@googlegroups.com
There is something definitely broken about this flag. Looking at the XML, if the flag is on, you get this

quoteSubstitution="YES"

but if it is off, it is not listed at all.

But, at least for me, I am getting isAutomaticQuoteSubstitutionEnabled showing as on, even when the checkbox in the xib shows as off.

Looks like I'll have to brute force it to set it off after loading.

Wacky.
Peter.


--
Keyboard Maestro 6.2 now out - control Mail, reveal a file, format AppleScripts and more.

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/> <http://download.keyboardmaestro.com/>

Abhi Beckert

unread,
Oct 31, 2013, 1:43:29 PM10/31/13
to jstal...@googlegroups.com
In my app I just override the method in a subclass to disable quote substitution and all the other stuff. Haven't had any issues with it:


(BOOL)isAutomaticQuoteSubstitutionEnabled
{
  return NO;
}

--
You received this message because you are subscribed to the Google Groups "JSTalk Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jstalk-dev+...@googlegroups.com.
To post to this group, send email to jstal...@googlegroups.com.
Visit this group at http://groups.google.com/group/jstalk-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Peter N Lewis

unread,
Nov 1, 2013, 11:08:07 PM11/1/13
to jstal...@googlegroups.com
On 1 Nov 2013, at 1:43 , Abhi Beckert <ab...@abhibeckert.com> wrote:
> In my app I just override the method in a subclass to disable quote substitution and all the other stuff. Haven't had any issues with it:

Yes, that would work. I've narrowed it down I think the issue is:

* If the xib is created with Xcode 5
* and read under Mavericks
* then isAutomaticQuoteSubstitutionEnabled is initialised to true regardless.

You can override isAutomaticQuoteSubstitutionEnabled, or just call setAutomaticQuoteSubstitutionEnabled:NO.

Or you could probably edit the .xib in Xcode 4.6, though I don't have that so I can't verify it, and I'm not even sure Xcode 4.6 would be able to read the .xib, though presumably it would otherwise 10.8 wouldn't either.

Enjoy,
Peter.

Abhi Beckert

unread,
Nov 2, 2013, 12:03:27 AM11/2/13
to jstal...@googlegroups.com

On 2 Nov 2013, at 1:08 pm, Peter N Lewis <pe...@stairways.com.au> wrote:

Or you could probably edit the .xib in Xcode 4.6, though I don't have that so I can't verify it, and I'm not even sure Xcode 4.6 would be able to read the .xib, though presumably it would otherwise 10.8 wouldn't either.

Xcode 4.6 cannot read the new format, it is a complete rewrite. To be honest, they should have changed the filename extension.

Xib files are compiled into nib files, so 10.8 doesn't need to support it, only the binary nib format gets deployed.
- Abhi

Peter N Lewis

unread,
Nov 5, 2013, 9:43:04 PM11/5/13
to jstal...@googlegroups.com
Ahh, yes. It is probably the xib2->nib compiler that is broken then.
Reply all
Reply to author
Forward
0 new messages