Xcode将文件框中的gpx文件变灰 [英] Xcode greys out gpx files in filebox

查看:132
本文介绍了Xcode将文件框中的gpx文件变灰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我不会忽略任何内容,但是我无法将gpx文件加载到Xcode中,因为它们在文件框中显示为灰色(参见图片)。这在两个位置菜单中

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. 在调试器/位置菜单中(请参见将GPX文件添加到项目下的图片,

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

scema位置菜单,但是预设(伦敦等)确实起作用。

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

选择将GPX文件添加到项目会为我显示灰色的gpx文件:

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

在这里所有其他文件都变灰是正确的,但是gpx文件应该是
BTW:它不会帮助将文件拖到项目中,因为它不会显示在模拟位置菜单中。

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.

要使它们正常工作,我需要什么魔术?我正在使用Xcode 4.6.2

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

我使用的格式是:

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

预先感谢。

编辑:同时


  • 在Mac上创建了一个应该具有干净用户路径的新用户

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

在删除我可以在用户和全局域上找到的所有设置和首选项后重新安装Xcode(虽然可能会错过一些)。

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

启动没有内核扩展的Mac

startet the Mac without kernel extensions

还有其他想法如何解决该问题吗?

Any other ideas how to fix the problem out there?

推荐答案

我们将问题归结为文件的ContentType声明有缺陷。 Mac OS X中引入的
扩展名将不再识别Snow Leopard文件(众所周知,从unix时代开始)-而是每个包含内容类型的文件都有一些元信息。

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.

您可以在名为mdls的终端实用程序的帮助下查看每个文件的元数据。
因此,在此示例中,我们通过触摸创建了一个空* .gpx文件并显示其元数据:

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

因此您可以看到文件扩展名* .gpx默认分配给内容类型 com.apple.dt.document.gpx。
在此特定问题中,默认扩展名-内容类型映射由第三方应用程序修改(称为Adze( http:// kobotsw .com )),导致Xcode无法正确识别该文件。

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.

解决此问题的最简单方法是通过系统偏好设置重置聚光灯索引。打开Spotlight-Prefpane,切换到Privacy-Tab,然后将Macintosh-卷(/)拖到TableView中-保存此设置后,可以从TableView中删除Macintosh-卷,这将导致整个Spotlight重新索引。

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.

这篇关于Xcode将文件框中的gpx文件变灰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆