为什么Objective-C文件使用.m扩展名? [英] Why do Objective-C files use the .m extension?

查看:158
本文介绍了为什么Objective-C文件使用.m扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我开始学习Objective-C和Cocoa以来,我一直想知道为什么他们为实现文件选择了扩展名.m-应该是某些含义还是仅仅是一个随机字母?

解决方案

今天,大多数人将它们称为方法文件",但是

.m扩展名最初代表 首次使用Objective-C时的" m 消息" 介绍,指的是中央 Objective-C [...]"

的功能

(摘自《 在Mac上学习Objective-C ",作者是马克·达林普(Mark Dalrymple)和斯科特·纳纳特(Scott Knaster),第9页)

编辑:为了满足自己的需求,我通过电子邮件发送了 Brad Cox , Objective-C的发明者,关于这个问题,他用以下单行回答:

因为采用了.o和.c.很简单 那样."

这是电子邮件的视觉证明:

Since I started learning Objective-C and Cocoa, I've been wondering why they have chosen the extension .m for the implementation files - was it supposed to mean something, or was it just a random letter?

解决方案

Today most people would refer to them as "method files", but

"The .m extension originally stood for "messages" when Objective-C was first introduced, referring to a central feature of Objective-C [...]"

(from the book "Learn Objective-C on the Mac" by Mark Dalrymple and Scott Knaster, page 9)

EDIT: To satisfy an itch I emailed Brad Cox, the inventor of Objective-C, about the question and he answered with this single line:

"Because .o and .c were taken. Simple as that."

Here's the email as visual proof:

这篇关于为什么Objective-C文件使用.m扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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