我可以查看 .m || PC 上的 .h 文件是否具有正确的文本间距?

发布于 2024-12-20 02:20:51 字数 391 浏览 2 评论 0原文

我正在使用 Xcode 构建一个“相当”复杂的 iPhone 程序。不幸的是,我只能在正常时间进行编程——当我在工作场所可以使用 Mac 时。尽管我很喜欢继续工作的想法,但我发现,当我不不断地思考和观察它时,很难编写一个大项目。

因此,如果有人知道我可以在电脑上查看我的.m文件的方法,我将非常感激听到这是怎么回事!让我明确一下:我不想在这台电脑上编译/构建。我想要做的就是获得屏幕上文本的视觉效果,并以保留空白的方式做到这一点!

众所周知,.h 是 C++ 语言,并且似乎在任何 C++ 开发程序中都可以查看它(以适当的间距);但是,事实似乎并非如此。是否可以在电脑上同时读取 .h.m 文件?

I am building a 'fairly' complicated iPhone program using Xcode. Unfortunately I am limited to program only during normal-people hours-- when I have access to a Mac, at my work place. As much as I like the idea of keeping my work @ work, I'm finding that it's difficult to code a big project when I'm not constantly thinking about it and looking at it.

Therefore, if anybody knows a way that I could view my .m files on my pc, I would be very grateful to hear how this could be! Let me be clear: I don't want to compile/build on this pc. Alls-I-wants-to-do is get the visual of the text on my screen AND to do this in a way that my white-space is preserved!

As we all know, .h is C++ talk, and it seems like it would be viewable (with the appropriate spacing) in any C++ development-program; But, that doesn't seem to be the case. Is this at all possible to read both .h and .m files on a pc?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

好听的两个字的网名 2024-12-27 02:20:51

.m 文件只是文本文件。您可以在任何文本编辑器中打开它们。我能想到的唯一问题是文本编辑器默认以 8 个空格呈现选项卡,无法对此进行配置,但任何程序员的文本编辑器都可以让您控制它。我不是 Windows 用户,但我想 Notepad++Sublime Text 或任意数量的其他编辑器都符合要求。

.m files are just text files. You can open them in any text editor. The only issue I can think of is text editors that default to rendering tabs at 8 spaces with no way to configure this, but any programmer's text editor will give you control over it. I'm not a Windows guy but I imagine Notepad++ or Sublime Text or any number of other editors would fit the bill.

沉溺在你眼里的海 2024-12-27 02:20:51

.m 文件只是一个文本文件。任何文本编辑器都可以很好地打开它们。

我推荐 Notepad++ 因为它有不错的 Objective-C 语法荧光笔。

.m file is just a text file. Any text editor will open them just fine.

I recommend Notepad++ as it has decent Objective-C syntax highlighter.

神也荒唐 2024-12-27 02:20:51

另外,值得一提的是,您可以在 Emacs 或 Eclipse 中加载 Objective C 文件,这两者都是跨平台的(Linux、MacOS、Windows 等);理解 Objective-C 语法;并且(如果您加载 GCC,Gnu 编译器集合)可以编译任何不需要 Apple 框架的文件。 (我想你的大部分 iPhone 应用程序都会有实际编译所需的 Apple 框架……)

(正如我的其他评论中所述,请忽略非 MacOS 系统上的 ._* 文件。)

Also, for what it's worth, you can load Objective C files in Emacs or Eclipse, both of which are cross-platform (Linux, MacOS, Windows, whatever); understand Objective-C syntax; and (if you load GCC, the Gnu Compiler Collection) can compile any files that don't require Apple Frameworks. (I imagine that most of your iPhone app will have Apple Frameworks needed to actually compile, though…)

(As noted in my other comment, ignore the ._* files on a non-MacOS system.)

思慕 2024-12-27 02:20:51

.m 文件只是 Obj-C 文件,它们与任何 .c.c++ 文件的格式完全相同,并且可以在任何好的文本编辑器中完美打开(Notepad++ 似乎很受欢迎)。您不需要将文件重命名为以 .txt 或其他内容结尾,只需将其保留为 .m 并在 Notepad++ 中打开它即可。

编码很可能是 UTF-8,您可能需要将 Windows 编辑器配置为默认使用此编码。您还应该将其配置为使用“UNIX”换行符 (\n)。

如果您选择的编辑器无法识别文件类型并自动进行语法突出显示,请尝试将其设置为使用 C++ 作为语言。它与 Obj-C 不是同一种语言,但足够接近来完成这项工作。

名称以._开头的文件不是任何可以在PC上打开的文件。它们是同名文件的“资源分支”,通常用于存储文件实际内容以外的数据。 PC 文件系统上不存在资源分支,因此 Mac OS 会创建 ._ 文件。

它们也被苹果正式弃用,就像十年前一样,您应该尝试追踪哪些程序正在创建 ._ 文件并提交错误报告,要求他们请更新他们的程序以停止创建它们。

删除名称中包含 ._ 的任何文件通常是安全的,但并非总是如此。就您而言,我猜测它们包含您上次在 Mac 上打开文件时的确切窗口位置或光标位置。有更好的方法来存储该信息,因此我会提交错误报告。

The .m files are just Obj-C files, they are exactly the same format as any .c or .c++ file, and will open perfectly fine in any good text editor (Notepad++ seems popular). You do not need to rename the file to end in .txt or anything, just leave it as .m and open it up in Notepad++.

Chances are the encoding is UTF-8, you may need to configure your windows editor to use this encoding by default. You should also configure it to use "UNIX" newlines (\n).

If your editor of choice doesn't recognise the file type and automatically do syntax highlighting, try setting it to use C++ as the language. It's not the same language as Obj-C, but close enough to do the job.

The files who's name begins with ._ are not anything that can be opened on a PC. They're the "resource fork" of the file with the same name, and are typically used to store data other than the file's actual content. Resource forks do not exist on a PC filesystem, so Mac OS makes the ._ files instead.

They are also officially deprecated by apple, something like ten years ago and you should try to track down what program is creating ._ files and submit a bug report, asking them to update their program to stop creating them please.

It is usually safe to delete any file with ._ in the name, but not always. In your case, I'm guessing they contain the exact window position from the last time you opened the file on a mac, or the cursor location. There are better ways to store that info, so I'd file a bug report.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文