Xcode keeps guessing and interpreting with wrong encoding - xcode

I am using Xcode 4.0.2, the latest release of Xcode. All my projects or standelone source codes are in UTF-8 encoding. But when I open some source file (C/C++/Objective C), all text is interpreted in Mac OS Roman encoding and I don't know why. I've tried remove and delete all Xcode files by uninstalling Xcode. So reinstalling doesn't help. All source codes are opened in Mac OS Roman encoding. In Xcode settings I have default encoding UTF-8 (but that is for new files I think). Also I've tried reinstall libiconv that Xcode may use for detecting encodings.
I don't know about anything that may caused this. I didn't make any changes to my system, programs or data and I am sure, this I didn't have this problem one week ago.
Anyone?
Thanks,
Martin

If you open up the right side view (top right view buttons) there are some settings.
Try setting the encoding there under 'text settings' for that file.
You may need to copy in your text again if the reinterpretation doesn't work.

Related

Xcode Source Editor option not displayed in Extensions

Is there a way to activate Xcode Source Editor option in System Preferences > Extensions? For some reason, it's not showing on my Mac (the last option).
If the Xcode Source Editor is missing from the left pane (see image above), try one of these solutions before resorting to a reinstallation:
In the Applications folder, rename Xcode and then change the name back to Xcode, or move Xcode.app out of the Applications folder, then back in, as described by this Stack Overflow answer.
Move the Xcode app to the Trash and re-install it from the AppStore.
I install the Xcode manually that's why not found on Extensions.
To fix quickly:
Quit Xcode
Rename Xcode in the applications folder temporarily with any name.
Launch renamed Xcode
Quit Xcode
Name it back to the old value ("Xcode")
Go back to Extention you will find the Xcode
The entry is shown if the system detects that both Xcode and at least one Xcode extension is installed. Yet the code to detect Xcode has a few issues.
If you install Xcode first and don't have an extension, the entry is not shown. If you then install an extension, the system re-checks if Xcode is still installed and if yes, it should add the entry. However, the check code will fail in some situations. E.g. if you renamed Xcode.app to something like Xcode_13.4.app (as you need to manage different versions of Xcode), the detection code may not find it. It also may not find it if you moved Xcode to a different location outside of /Applications. And even if not renamed and still in the default location, the detection code sometimes fails and the exact reason why that happens is unknown (it may have issues with certain ownership, certain file permissions, case-sensitive file systems, etc.)
In all these situations, renaming Xcode causes it to be re-detected by the system and then the system sees that Xcode and at least an extension is installed and the entry appears immediately. No need to reboot or start the renamed Xcode; you rename it, you rename it back, and the entry is there and will stay there (even after deleting all extensions, it stayed on my system).
If you first installed any app with an extension and then Xcode, the problem does never appear as in that case you immediately trigger the rename-fix above, because the moment you install Xcode, the system will always detect it correctly (regardless how the app is named or where it is located or any other issue the scan code might have) and detecting Xcode and knowing there is an extension, the menu entry appears at once. The code that detects Xcode extensions seems to always work correctly.
This is probably one of the issues where the Xcode detection code has not been tested very well by the Apple but since it seems to work for the vast majority of users, Apple sees no reason to further investigate why it would sometimes fail.
It will get activated by default if any plugin are added in Xcode.
You have to download XcodeClangFormat plugin from GitHub and follow the installation steps. Then Xcode Source Editor will be visible automatically.
Please refer this link

How do I delete a font in IntelliJ?

I am trying to replace the Inconsolata font with its older version in IntelliJ (the newer version added things that I'm not happy with)
IntelliJ seemingly refused to remove a font that I wish to be removed.
The font in question is Inconsolata, and the picture below shows me trying to delete it. It works, at this stage.
However, after doing that, and restarting the PC, IntelliJ insists that the font exists.
It will give a strange name to the font, but the entry exists. This causes problem on my end - there's some reference caching the IntelliJ is doing, and if I were to replace the font with the older version, it'll still be using the newer cache, but will give a strange output if the cache is pointing to something that doesn't exists.
I've tried
Deleting the settings folder
Reinstalling IntelliJ and then restarting
Is there a way to delete a font in IntelliJ properly?
It looks like Windows doesn't properly delete a font. Unfortunately, this causes problems for some apps.
The fix
Head towards C:\Windows\Fonts from your terminal. Do not use a file browser, as that will open up the control panel item.
Delete all traces of inconsolata (There was Inconsolata-Bold.ttf, Inconsolata-Regular.ttf, inconsolata.otf) using a terminal
Now your IDE will no longer have the Inconsolata font.

This bundle is invalid. Apple is not currently accepting applications built with this version of the OS. (Mavericks)

I start by saying that I've installed Mavericks, I was curious to see the new features...
It was better to wait, because (apparently) there are no sensational changes.
Anyway, I'm trying to submit my app to the app store, but after a real hard fight with the code-signing, I have ended up with this message:
"This bundle is invalid. Apple is not currently accepting applications built with this version of the OS."
....From what I read, the only solution seems to uninstall Mavericks and go back to Mountain Lion, but I will be happy if someone else has got a alternative fix.
After some research on Internet I've found a fix for this problem.
1) Open "App Store" and leave it for now.
2) press cmd+shift+g on your desktop and go to /system/library/coreservices/
2) Copy SystemVersion.plist to your desktop, and duplicate the file
3) Open the file with the right name on your desktop, not the copy, and replace the old part with this:
<key>ProductBuildVersion</key>
<string>12E55</string>
<key>ProductCopyright</key>
<string>1983-2013 Apple Inc.</string>
<key>ProductName</key>
<string>Mac OS X</string>
<key>ProductUserVisibleVersion</key>
<string>10.8.4</string>
<key>ProductVersion</key>
<string>10.8.4</string>
4) Now copy this edited file to /system/library/coreservices, and go to "App store" application.
5) Download Xcode 4.6.3, now you can because your OsX is detected as Mountain Lion.
6) Once the download its finish, and Xcode installed, reboot.
7) Open your project in xcode 5 beta, if you have some .xib files, go in the file inspector, document versioning, and change development version to 4.6 instead of 5. Do this for each .xib, then close xcode 5
8) Open Xcode 4.6.3 and reopen your project. Check in the build settings that 10.9 is not present anywhere. Replace it with 10.8 or whatever you need.
9) Make clean, Build for archiving, Archive ... Cross your finger!
10) Your project should be validated now.
11) Once you uploaded your app, rename the SystemVersion.plist (copy) on your desktop, and copy it back to /system/library/coreservices. You don't need to reboot.
It's kinda a hack, but if you don't want to reinstall everything, it's the only way to go.
P.s: after replacing SystemVersion.plist, you will notice strange behaviors in the Os, like safari that isn't working and so on, that's why I suggested to duplicate the plist file, before changing the os version. Anyway if you can still use terminal and "vi" to restore everything, if for some reason you didn't copy the original.
Hope this will help someone. I've lost a day figuring out a solution ;)
Same problem with build 13A3017 on Mavericks
Switched it to 13A603 and it worked.
It's quicker to use this command in terminal and just make a note of the original build number to switch it back afterwards.
sudo nano /System/Library/CoreServices/SystemVersion.plist
but should probably make a copy of the file first just in case
I got this problem while I was using Mavericks 10.9.1 (build 13B40) and Xcode 5.1 dp. I finally solve the problem by:
Use Xcode 5.0.2 instead of Xcode 5.1 dp.
Go to /system/library/coreservices/ and modify the SystemVersion.plist using the copy/paste as #Benz 's answer. Thanks to #Benz
After copying and backing the SystemVersion.plist, modify the content as following:
mod ProductBuildVersion to 13A603, which is the build number of Mavericks 10.9.0 GM.
mod ProductUserVisibleVersion and ProductVersion to 10.9.0
Replace the SystemVersion.plist using the one you've modified.
Restart the Xcode.
Rebuild and achieve the app.
Submit.
Succeed!!!
Restore the SystemVersion.plist using the original file you've backed.
If you don't want to mass with the SystemVersion.plist, here is another way to get through it on 10.10:
After you made the archive, you can modify the .app bundle and .plist in the archive's root to match a valid accepting version. Then use the Xcode to submit it. No need to mass with the code signing or Application Loader.
If you want a simple solution and don't mind to pay for it, I've created a tool to do it with ease: https://vox.vg/xcarchiver/

View plist raw xml in monodevelop

I really need to see the xml of the plist in monodevelop or in xcode.
Currently the plist file doesn't appear in xcode only in monodevelop and i cant find a way to edit the xml directly.
As a general rant monodev is great but why have this gui editing of xml at all when probably one key reason why people are avoiding xcode is because of its insistence of this obfuscation.
Thanks for any pointers
It might work depending on what software you have installed.
E.g. from MonoDevelop I can right click on my Info.plist, select Open With and choose Dashcode.app.
This works (for me) because I still have my old Xcode 4.2 installed (on OSX Lion) and that ships with dashcode as a separate .app.
AFAIK MonoDevelop queries the operating system for any application that can open .plist files. So if you have an application that can read them (or XML) you should be able to create this association (using Finder) and have MonoDevelop open it.
Anyway you should fill a bug report (enhancement) on MonoDevelop so it can open those .plist files using it's own XML editor.

Can't find Scripting Bridge header files: mail.h iCal.h after upgrading Xcode

This should be easy..
I recently upgraded to the newest version of Xcode on 10.7 from Xcode 3.6 I believe.
I have been working with scripting bridge for both Apple Mail and iCal.
Previously, I could use FILE > Open Quickly... to view either the mail.h or iCal.h header files as entering the file name revealed only one file... the correct one.
Now, when I enter either mail.h or iCal.h using Open Quickly, dozens of files come up in the list, but NONE of them are the correct Scripting Bridge header files.
Can anyone tell me where and/or how to view these header files again? It is driving me just a bit nuts here..
Thanks!
Ok... solution found.
Aparently, the file no longer shows up as "mail.h" or "iCal.h" in the Open Quickly list.
It now shows up as "mail" or "iCal" but with a different icon than before. The new icon shows as an underlined "C" in a brown square.
If you type the ".h" extension then it won't show up in the list at all.
Ugh.

Resources