Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 776 Vote(s) - 3.52 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why do Objective-C files use the .m extension?

#1
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?
Reply

#2
.m files contain the (m)ethods. Possible reason?
Reply

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

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

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

**EDIT:** To satisfy an itch I emailed [Brad Cox][2], 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:

![Visual Proof][3]



[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:
Reply

#4
It stands for "methods". From the [comp.lang.objective-C FAQ][1]:

> The organisation of Objective-C source is typically similar to that of C or C++ source code, with declarations and object interfaces going into *header* files named with a .h extension, and definitions and object implementations going in files named with a .m (short for *methods*) extension.

[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through