google-objective-c-style

Applies Google's Objective-C naming, formatting, and memory-management conventions when writing or reviewing code.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/chughtapan/google-guide-skills --skill google-objective-c-style-chughtapan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-objective-c-style
Source: https://github.com/chughtapan/google-guide-skills/tree/main/skills/google-objective-c-style
Command: npx skills add https://github.com/chughtapan/google-guide-skills --skill google-objective-c-style-chughtapan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Objective-C codebases drift into inconsistent naming, formatting, and memory-management patterns, making code harder to review and maintain. This Skill gives an agent the complete Google Objective-C style rules so it can write and review code that matches Google's conventions without manual lookup. ## Core Features & Use Cases - Naming and formatting rules: Covers prefixes, category naming, method and variable naming, constants, include ordering, and method declaration layout. - Memory and ownership guidance: Enforces rules for copying mutable objects, delegate retain cycles, designated initializers, nil checks, and nullability annotations. - Review-ready conventions: Flags banned patterns such as +new, thrown exceptions, unsigned integer math, and unsafe BOOL conversions. - Use Case: While reviewing an Objective-C++ pull request, the agent checks that category methods are prefixed, initializers avoid messaging self, and collection properties use copy semantics. ## Quick Start Review this Objective-C class using the Google Objective-C style guide and list any naming, memory-management, or formatting violations.

Frequently Asked Questions about google-objective-c-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I name Objective-C methods and categories under Google's style guide?

Method names start lowercase with mixed case and should read like a sentence, with accessors named after the attribute without a get prefix. Category files use ClassName+CategoryName.h, and category methods get a lowercase prefixed underscore form like gtm_myMethod: to avoid collisions.

What are the Google Objective-C rules for memory management and copying?

Initializers and setters should copy objects that have mutable variants rather than retaining them, and synthesized accessors use the copy keyword. Delegates and targets should be held weakly to avoid retain cycles, and blocks used as callbacks must be explicitly released.

Does this style guide apply to Swift code?

No, the guide explicitly states it must not be used as a Swift style guide. It covers Objective-C and Objective-C++ only; within Objective-C++ files, C++ methods follow the C++ style guide's naming rules.

Can I use exceptions or the +new method in Google-style Objective-C?

No, code should never @throw Objective-C exceptions, though @try/@catch is allowed for third-party calls that throw. The NSObject +new method must not be invoked or overridden; use +alloc and -init instead.

Why should unsigned integers be avoided in Objective-C code?

Unsigned integers cause subtle errors in math and countdown-to-zero loops, so signed integers are required in arithmetic except when matching NSUInteger in system interfaces. Unsigned types remain acceptable for flags and bitmasks, though NS_OPTIONS or NS_ENUM is often preferable.