<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSNotification/notificationWithName:object:userInfo:",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSNotification(cm)notificationWithName:object:userInfo:"
  },
  "title" : "notificationWithName:object:userInfo:"
}
-->

# notificationWithName:object:userInfo:

Returns a notification object with a specified name, object, and user information.

```
+ (instancetype) notificationWithName:(NSNotificationName) aName object:(id) anObject userInfo:(NSDictionary *) aUserInfo;
```

## Parameters

`aName`

The name for the new notification. May not be `nil`.

`anObject`

The object for the new notification.

`aUserInfo`

The user information dictionary for the new notification. May be `nil`.

## See Also

[`func post(name: NSNotification.Name, object: Any?, userInfo: [AnyHashable : Any]?)`](/documentation/Foundation/NotificationCenter/post(name:object:userInfo:))

Creates a notification with a given name, sender, and information and posts it to the notification center.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)