Вопрос

I hope I'm not overlooking anything, but I can't load gpx files into Xcode because they are greyed out in the filebox (see pic). This is in both location menues,

  1. in the debugger/location menu (see pic below "Add GPX File to Project" and

  2. the scema location menu. However, the presets (London etc) do work.

enter image description here

Selecting "Add GPX File to Project" gives me the greyed out gpx files:

enter image description here

It's fine and right that all other files are greyed out here, but gpx files should be not greyed out. BTW: it won't help to drag the file into the project, because it won't show up in the simulation location menu.

What magic do I need to get them to work? I'm using Xcode 4.6.2

The format I use is this:

<?xml version="1.0"?>
<gpx version="1.1" creator="Xcode"> 
<wpt lat="49.479606" lon="8.470395">
     <name>MannheimHbf</name>
</wpt>
</gpx>

Thanks in advance.

EDIT: meanwhile I've

  • created a new user on my Mac that should have a "clean" user path

  • reinstalled Xcode after deleting any settings and prefs I could find on the user and global domain (might have missed some though).

  • startet the Mac without kernel extensions

Any other ideas how to fix the problem out there?

Это было полезно?

Решение

We tracked the problem down to a defective ContentType-Declaration of the file. Introduced in Mac OS X Snow Leopard files will no longer recognized by it's extension (as we all know it from old unix times) - instead there is some meta information for each file which holds a Content Type.

You can see those meta-data for each file with the help of the terminal utility called mdls. So in this example we create an empty *.gpx-file via touch and display its meta-data:

% touch bla.gpx                                              <Tuesday 09:11:23>
saschaheld@Saschas-MacBook-Pro:~
% mdls bla.gpx                                               <Tuesday 09:11:25>
kMDItemContentCreationDate     = 2013-06-04 07:11:25 +0000
kMDItemContentModificationDate = 2013-06-04 07:11:25 +0000
kMDItemContentType             = "com.apple.dt.document.gpx"
kMDItemContentTypeTree         = (
    "com.apple.dt.document.gpx",
    "public.xml",
    "public.text",
    "public.data",
    "public.item",
    "public.content"
)
kMDItemDateAdded               = 2013-06-04 07:11:25 +0000
kMDItemDisplayName             = "bla.gpx"
kMDItemFSContentChangeDate     = 2013-06-04 07:11:25 +0000
kMDItemFSCreationDate          = 2013-06-04 07:11:25 +0000
kMDItemFSCreatorCode           = ""
kMDItemFSFinderFlags           = 0
kMDItemFSHasCustomIcon         = 0
kMDItemFSInvisible             = 0
kMDItemFSIsExtensionHidden     = 0
kMDItemFSIsStationery          = 0
kMDItemFSLabel                 = 0
kMDItemFSName                  = "bla.gpx"
kMDItemFSNodeCount             = 0
kMDItemFSOwnerGroupID          = 20
kMDItemFSOwnerUserID           = 501
kMDItemFSSize                  = 0
kMDItemFSTypeCode              = ""
kMDItemKind                    = "GPX File"
kMDItemLogicalSize             = 0
kMDItemPhysicalSize            = 0

So as you can see the file extension *.gpx assigned per default to the content type "com.apple.dt.document.gpx". In this specific problem the default extension - contenttype-mapping was modified by an third party application (called Adze (http://kobotsw.com)) which results in Xcode not recognizing the file correctly.

The easiest way to fix this problem is by resetting your spotlight index via the system preferences. Open the Spotlight-Prefpane, switch to the Privacy-Tab and drag your Macintosh-Volume (/) into the TableView - After you have saved this settings, you can remove the Macintosh-Volume from the TableView, which will result in a complete spotlight reindex.

Please keep in Mind, that the reindexing can take some time depending on your amount of files, read speed and volume size.

Другие советы

I resolved this issue by deleting a beta version of Xcode, which for some reason had files "in use" by non-beta Xcode. Steps:

  • Quit running (non-beta) Xcode
  • Delete Xcode beta
  • Restart Xcode

GPX files no longer grayed out.

Are you sure they're GPX files, and not, for example, .gpx.txt files with a hidden extension?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top