.M

Файл M

Objective-C source file
Задать вопрос
БЫСТРЫЙ ОТВЕТ

An M file is most commonly an Objective-C implementation file - the code half of an Objective-C class, used to build macOS and iOS apps. Open it in Xcode on macOS or any code editor such as VS Code. The same .m extension is also used by MATLAB scripts, Mathematica packages, and Maple files, so the contents tell you which it actually is.

Разработчик: Apple (Objective-C language; originally Stepstone/Brad Cox & Tom Love, 1984) Категория: Файлы разработчика Открыть стандартное MIME: text/x-objcsrc
ОТКРЫВАЕТСЯ НА Windows macOS Linux
Связанные: .DO · .MD · .HEX · .XSD

На этой странице

Проиндексировано расширений: 19k+
Последняя проверка: Jul 1, 2026

Не знаете, что это за файл?

Перетащите любой файл в наш идентификатор - мы прочитаем первые байты, чтобы определить формат.

Идентифицировать файл

Что такое формат файла M?

.m is a plain-text file format used for storing source code written in the Objective-C programming language. A closely related extension, .mm, supports Objective-C mixed with C++ (Objective-C++). .m files are commonly found on Mac or Windows machines used for developing macOS and iOS applications. Each .m implementation file pairs with a companion .h header of the same base name, which holds the class interface declarations.

Objective-C is a programming language that adds object-oriented capabilities to the C language. Objective-C uses the Cocoa and Cocoa Touch frameworks and is mainly used for writing apps for Apple devices. Unlike C++, Objective-C is a strict superset of ANSI C. An .m file typically begins with #import directives (e.g. #import <Foundation/Foundation.h>) and contains @implementation ... @end blocks defining a class's methods. Since 2011, Automatic Reference Counting (ARC) automates memory management, removing the need for manual retain and release calls. .m files are compiled by clang inside Xcode. Since Apple introduced Swift in 2014, Objective-C is no longer the default for new projects, but .m files remain widespread in legacy codebases and in mixed Swift/Objective-C work.

Безопасность и защита

РИСК: LOW

A .m file is plain source code - it does nothing until compiled and run, so the file itself is low risk. The normal source-code cautions apply: read before you build, since compiling and executing unknown code can do anything the resulting program is allowed to do, and source from untrusted repositories may hide malicious logic. There is no macro or auto-execution mechanism in a .m file by merely opening it in an editor. (If the .m turns out to be MATLAB rather than Objective-C, the same advice holds - don't run untrusted scripts.)

Детали формата

в двух словах
ПОЛНОЕ НАЗВАНИЕObjective-C source fileтакже известен как Objective-C implementation file, Objective-C class implementation (.m)
РАЗРАБОТЧИКApple (Objective-C language; originally Stepstone/Brad Cox & Tom Love, 1984)с Objective-C language 1984; .m as the standard implementation-file extension since the NeXTSTEP era (late 1980s)
MIME-ТИПtext/x-objcsrc
ТИПPlain-text source code
СТАНДАРТОткрытый · без роялти
СВЯЗАННЫЕ.do.md.hex.xsd
Это расширение также используется в…
  • MATLAB script / function file (.m) - Plain-text MATLAB code - scripts and functions for MathWorks MATLAB/Octave; the most common .m file in scientific/engineering use, a different language entirely.
  • Wolfram Mathematica package (.m) - A Wolfram Language package/source file (also seen as .wl) holding definitions, opened by Mathematica.
  • Maple input/.m library file - Maple uses .m for its internal (often binary) library/save files and Maple input code.

Программы, открывающие файлы M

Windows3 apps
Notepad Открытый код Open the .m as plain text/code with C-family syntax highlighting for quick viewing on Windows.
Visual Studio Code Бесплатно Open the .m to view/edit with syntax highlighting (install an Objective-C extension). Note: building Apple apps needs macOS/Xcode; on Windows VS Code is for reading/editing the source.
gVim / Vim Открытый код Open the .m as a text/code file. Lightweight editor with Objective-C syntax support. (db lists gVim as recommended - valid as a generic code editor.)
macOS3 apps
Apple Xcode Бесплатно The native tool: open the project/.m to edit, build and debug Objective-C. Includes the clang compiler and Interface Builder.
BBEdit Freemium Mac text editor with Objective-C syntax highlighting for viewing/editing .m files.
Visual Studio Code Бесплатно Open the .m to view/edit with syntax highlighting (install an Objective-C extension). Note: building Apple apps needs macOS/Xcode; on Windows VS Code is for reading/editing the source.
Linux2 apps
Visual Studio Code Бесплатно Open the .m to view/edit with syntax highlighting (install an Objective-C extension). Note: building Apple apps needs macOS/Xcode; on Windows VS Code is for reading/editing the source.
Vim / jEdit Открытый код Open the .m as a code file. jEdit and Vim both highlight Objective-C; build via GNUstep + clang.

Технические подробности

глубокая спецификация
File typePlain-text source code (no binary component)
MIME typetext/x-objcsrc (also accepted as text/plain)
Character encodingUTF-8 or ASCII-compatible; historically also Mac Roman or Latin-1
File signature (magic bytes)None - identified by .m extension only; plain text with no binary header
Typical file structure#import directives followed by one or more @implementation ... @end blocks
Companion header file.h file of the same base name holds the class interface (@interface ... @end)
Key syntax tokens@implementation, @end, @property, @synthesize, #import, - (returnType)methodName
Compilerclang (LLVM); historically gcc before Apple switched in 2012
Memory management modelManual Reference Counting (MRC) or Automatic Reference Counting (ARC, since Xcode 4.2 / 2011)
Associated frameworksCocoa (macOS), Cocoa Touch (iOS/iPadOS)
Typical file sizeA few hundred bytes to several hundred KB of source text
Objective-C++ variant.mm extension used when Objective-C code must interoperate with C++
Associated platformsmacOS, iOS, iPadOS (primary); GNUstep enables use on Linux and Windows
IDE and build toolingApple Xcode (primary IDE); clang and xcodebuild also used from the command line
ВыпущенObjective-C language 1984; .m as the standard implementation-file extension since the NeXTSTEP era (late 1980s)
Последняя версияObjective-C 2.0 (2006, Mac OS X 10.5); language is stable, now largely supplanted by Swift
Открыть стандартноеДа · без роялти
Спецификацияdeveloper.apple.com

Конвертации M

Вопросы и ответы сообщества

спрошено пользователями
Задать быстрый вопрос
Получите помощь от людей, работающих с файлами M. Будьте конкретны - укажите вашу систему и версию ПО.
Аккаунт не нужен · ответы обычно в течение дня

Вопросов пока нет - станьте первым, кто спросит о файлах M.

Часто задаваемые вопросы

What is a .m file?
In this database it's an Objective-C source file - the implementation (.m) half of an Objective-C class, used for macOS/iOS development. It's plain text. Note the .m extension is also used by MATLAB, Mathematica and Maple, which are different languages.
How do I open a .m file?
Open it in any code editor: Xcode on macOS (the native tool, with compiler), or Visual Studio Code, Vim, BBEdit or Notepad++ on any OS for viewing/editing. It's just text.
Is a .m file Objective-C or MATLAB?
Both languages use .m. Tell them apart by the contents: Objective-C has #import directives and @implementation/@end blocks (and a sibling .h file); MATLAB has 'function' definitions and matrix math. The creating program also indicates which it is.
What's the difference between a .m and a .h file?
They're two halves of an Objective-C class: the .h header declares the interface (@interface - what methods exist), and the .m implementation contains the actual code (@implementation). The .m #imports its .h.
Can I convert Objective-C (.m) to Swift?
Not automatically in any reliable way - migrating to Swift is a manual rewrite. Xcode supports mixed Objective-C/Swift projects via bridging headers so you can migrate gradually rather than all at once.
Do I need a Mac to work with .m (Objective-C) files?
To build Apple apps, yes - Xcode and the iOS/macOS SDKs are macOS-only. You can read and edit the .m source on any OS (VS Code, Vim), and GNUstep+clang lets you compile Objective-C on Linux/Windows for non-Apple targets.

Ссылки

1Apple - Programming with Objective-Cdeveloper.apple.com
2Apple - Xcodedeveloper.apple.com

Узнать больше

по всей базе данных

Популярные расширения на этой неделе

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.EXEWindows Executable (Portable Executable)
6.NOMEDIAAndroid No-Media Marker File
7.BINCD/DVD Disc Image (BIN/CUE)
8.RPMSGRestricted Permission Message
9.TMPTemporary File
10.XDWDocuWorks Document

Похожие расширения

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Бесплатные инструменты для файлов

Идентификатор файлов и конвертер изображений в браузере - все работает на вашем устройстве.

Открыть инструменты

Обзор расширений файлов A-Z