{"id":6086,"library":"pyobjc-framework-coreaudiokit","title":"PyObjC CoreAudioKit Framework","description":"PyObjC is a bridge between Python and Objective-C, enabling Python scripts to use and extend existing Objective-C class libraries, most importantly Apple's Cocoa frameworks on macOS. The `pyobjc-framework-coreaudiokit` package provides Python wrappers specifically for the CoreAudioKit framework. It is currently at version 12.1 and maintains an active release cadence, typically aligning with macOS SDK updates and Python version support.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","cocoa","audio","coreaudiokit","objective-c"],"install":[{"cmd":"pip install pyobjc-framework-coreaudiokit","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"This package provides the core bridging functionality between Python and Objective-C, upon which all PyObjC framework wrappers depend.","package":"pyobjc-core"}],"imports":[{"note":"PyObjC frameworks map to Python packages with the same name. Classes, constants, and functions from the Objective-C framework are available after importing the corresponding module.","symbol":"CAMultiColumnBrowser","correct":"from CoreAudioKit import CAMultiColumnBrowser"}],"quickstart":{"code":"import objc\nfrom CoreAudioKit import CAMultiColumnBrowser\n\ndef quickstart_example():\n    print(\"Demonstrating PyObjC CoreAudioKit import and class access.\")\n    try:\n        # Access the underlying Objective-C class object\n        # This verifies the framework is loaded and the class is accessible.\n        objc_class = CAMultiColumnBrowser.ObjC_CLASS\n        print(f\"Successfully accessed Objective-C class: {objc_class.className()}\")\n        print(\"Note: CoreAudioKit largely consists of UI components. Full functionality requires an active Cocoa application run loop.\")\n    except Exception as e:\n        print(f\"Error accessing CoreAudioKit class: {e}\")\n        print(\"Ensure you are on macOS and PyObjC is correctly installed.\")\n\nif __name__ == '__main__':\n    quickstart_example()","lang":"python","description":"This example demonstrates how to import a class from the CoreAudioKit framework and access its underlying Objective-C class object, verifying the PyObjC bridge is functioning for this framework. CoreAudioKit primarily offers UI components, so full interactive functionality typically requires an active Cocoa application run loop."},"warnings":[{"fix":"Upgrade your Python environment to Python 3.10 or later for PyObjC 12.x. Always check `requires_python` on PyPI or the PyObjC changelog for specific version requirements.","message":"PyObjC frequently drops support for older Python versions. PyObjC 12.0 dropped support for Python 3.9, and PyObjC 11.0 dropped Python 3.8.","severity":"breaking","affected_versions":"11.0+, 12.0+"},{"fix":"Review code that interacts with object initialization, especially custom subclasses or factory methods, to ensure correct reference handling. Explicit memory management is rarely needed in Python, but understanding the underlying Objective-C semantics is crucial for correct behavior.","message":"PyObjC 11.1 changed how initializer methods (`init` family) are modeled, now correctly reflecting that they 'steal' a reference to `self` and return a new one, as per clang's ARC documentation. This affects object lifecycle and reference counting.","severity":"breaking","affected_versions":"11.1+"},{"fix":"For versions 10.3 and later, review custom Python subclasses of Objective-C classes, especially those overriding `__new__` or `__init__`, to ensure they align with the current PyObjC instantiation model. Prefer the Pythonic class instantiation `SomeClass(x=1, y=2)` introduced in 10.3, or ensure you are on at least 10.3.1 for `__init__` compatibility.","message":"PyObjC 10.3 introduced changes to how `__init__` and `__new__` interact for Python subclasses of Objective-C classes, causing breakage for many existing projects. Version 10.3.1 partially reverted this, allowing `__init__` to be used when a user implements `__new__` or a superclass implements `__new__`. Code relying on PyObjC's provided `__new__` cannot use `__init__` if `init` methods are provided.","severity":"gotcha","affected_versions":"10.3 - 10.3.0"},{"fix":"Only use `pyobjc-framework-coreaudiokit` in macOS environments. For cross-platform audio development, consider alternative libraries not tied to Apple's ecosystem.","message":"PyObjC is a macOS-specific library and will not install or run on other operating systems. The frameworks it wraps (like CoreAudioKit) are Apple-proprietary.","severity":"gotcha","affected_versions":"All"},{"fix":"Always check for `None` before calling methods on PyObjC-wrapped objects that might originate from Objective-C `nil` values. E.g., `if my_obj is not None: my_obj.doSomething_()`.","message":"Unlike Objective-C, where sending a message to `nil` (equivalent to Python `None`) is a no-op, attempting to call a method on a Python `None` object (which PyObjC translates from `nil`) will raise an `AttributeError`.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}