# Nullability Annotations

Two groups of nullability annotations -`_Nullable/_Nonnull` and `nullable/nonnull`. The lowercase one is more elegant and works for almost all scenarios:

* Method declarations - write the annotation right after the open parenthesis of the parameter
  * `- (nullable NSString *) getItemWithIdentifier:(nonnull NSString*)identifier;`&#x20;
* Property declarations - write the annotation in the attributes list
  * `@property (copy, nonnull) NSString* name;`
* You can also define Nullability regions to mark specific regions in the file to consider any pointer type to be nonnull. So you need to explicitly mark only `nullable` properties/parameters
  * &#x20;`NS_ASSUME_NONNULL_BEGIN` and `NS_ASSUME_NONNULL_END`

Source: <https://developer.apple.com/swift/blog/?id=25>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.annjose.com/mobile-dev/ios-home/nullability-annotations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
