Portable framework for the Objective-C language. https://objfw.nil.im
  • Objective-C 93.4%
  • Assembly 2.4%
  • M4 1.6%
  • Makefile 1%
  • C 0.7%
  • Other 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-13 01:42:56 +02:00
.forgejo/ISSUE_TEMPLATE Update GitHub issue links 2025-06-22 19:28:39 +02:00
.github Fix GitHub Actions 2026-09-19 20:30:45 +02:00
build-aux Update buildsys 2026-09-17 01:47:04 +02:00
documentation *.gmi: Use proper ‘ instead of ' 2026-10-10 11:54:35 +02:00
generators Use hidden visibility instead of internal 2026-10-11 04:55:53 +02:00
misc ObjFWConfig.cmake: Avoid COMMAND_ERROR_IS_FATAL 2026-09-20 17:32:49 +02:00
src OFPollKernelEventObserver: Handle POLL{ERR,HUP} 2026-10-13 01:42:56 +02:00
tests Fix JSON5 test that wasn't adjusted to change 2026-09-27 12:38:17 +02:00
utils ofhttp: Add -4 and -6 switch 2026-10-04 20:39:23 +02:00
.editorconfig Add .editorconfig 2025-06-25 22:44:15 +02:00
.gitignore Clean up .gitignore 2026-08-02 00:36:47 +02:00
autogen.sh autogen.sh: Increase automake version for OpenBSD 2025-04-29 14:15:07 +00:00
buildsys.mk.in Update buildsys 2026-09-17 01:47:04 +02:00
configure.ac configure: Check if we need -Wno-unused-value 2026-09-19 14:29:45 +02:00
Doxyfile Rename OFPlugin -> OFModule 2025-03-15 13:48:08 +00:00
extra.mk.in generators/unicode: Use HTTPS 2026-08-21 23:40:39 +02:00
LICENSE-LGPLv3.gmi Convert license to Gemtext 2026-10-02 00:34:37 +02:00
LICENSE.gmi Convert license to Gemtext 2026-10-02 00:34:37 +02:00
Makefile Move CMake support files to misc 2026-02-19 23:49:06 +01:00
README.gmi README.gmi: Don't use * for emphasis 2026-10-10 23:18:55 +02:00

ObjFW

What is ObjFW?

ObjFW is a portable, lightweight framework for the Objective-C language. It enables you to write an application in Objective-C that will run on any platform supported by ObjFW without having to worry about differences between operating systems or various frameworks you would otherwise need if you want to be portable.

👉 Supported platforms

It supports all modern Objective-C features when using Clang, but is also compatible with GCC ≥ 4.6 to allow maximum portability.

ObjFW is intentionally incompatible with Foundation. This has two reasons:

  • GNUstep already provides a reimplementation of Foundation, which is only compatible to a certain degree. This means that a developer still needs to care about differences between frameworks if they want to be portable. The idea behind ObjFW is that developers do not need to concern themselves with portability and making sure their code works with multiple frameworks: Instead, if it works with ObjFW on one platform, they can reasonably expect it to also work with ObjFW on another platform. ObjFW behaving differently on different operating systems (unless inevitable because it is a platform-specific part, like the Windows Registry) is considered a bug and will be fixed.
  • Foundation predates a lot of modern Objective-C concepts. The most prominent one is exceptions, which are only used in Foundation as a replacement for abort(). This results in cumbersome error handling, especially in initializers, which in Foundation only return nil on error with no indication of what went wrong. It also means that the return of every init call needs to be checked against nil. But in the wild, nobody actually checks EACH and EVERY return from init against nil, leading to bugs. ObjFW fixes this by making exceptions a first class citizen.

👉 Read more about the differences to Foundation

ObjFW also comes with its own lightweight and extremely fast Objective-C runtime, which in real world use cases was found to be significantly faster than both GNU’s and Apple’s runtime.

Installation

👉 Installation instructions for various operating systems
👉 Instructions for compiling ObjFW from source

Usage

To create your first, empty application, you can use objfw-new:

objfw-new --app MyFirstApp

This creates a file MyFirstApp.m. The -[applicationDidFinishLaunching:] method is called as soon as ObjFW finished all initialization. Use this as the entry point to your own code. For example, you could add the following line there to create a “Hello World”:

[OFStdOut writeLine: @"Hello World!"];

You can compile your new app using objfw-compile:

objfw-compile -o MyFirstApp MyFirstApp.m

objfw-compile is a tool that allows building applications and libraries using ObjFW without needing a full-blown build system. If you want to use your own build system, you can get the necessary flags from objfw-config.

Documentation

🌐 Documentation for the latest released version of ObjFW

In order to build the documentation yourself (necessary to have documentation for main), you need to have Doxygen installed. Once installed, you can build the documentation from the root directory of the repository:

make docs

🌐 Doxygen

License

ObjFW is released under the GNU Lesser General Public License version 3.0.
👉 GNU General Public License version 3.0
👉 GNU Lesser General Public License version 3.0

If this license does not work for you, contact me and we can find a solution.

Bugs and feature requests

🌐 Bug tracker
🌐 File a new bug
📧 Send an e-mail

Support and community

If you have any questions about ObjFW or would like to talk to other ObjFW users, the following venues are available:

🌐 Discussions repository in which you can open an issue to start a discussion topic
🌐 Matrix room
🌐 Discord room, bridged to the Matrix room above
🌐 Signal room, bridged to the Matrix room above
🌐 Telegram room, bridged to the Matrix room above
🌐 Slack room, bridged to the Matrix room above
🌐 IRC channel #objfw on irc.libera.chat

Please don’t hesitate to join any or all of those!

Donating

👉 List of all possible ways to donate

Thanks

🌐 Jonathan Neuschäfer for reviewing the ENTIRETY (all 84k LoC at the time) of ObjFW’s codebase in 2017!
🌐 Hill Ma for donating an M1 Mac Mini to the project in 2022!