<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPopUpButtonCell/init(textCell:pullsDown:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPopUpButtonCell(im)initTextCell:pullsDown:"
  },
  "title" : "init(textCell:pullsDown:)"
}
-->

# init(textCell:pullsDown:)

Returns an `NSPopUpButtonCell` object initialized with the specified title.

```
init(textCell stringValue: String, pullsDown pullDown: Bool)
```

## Parameters

`stringValue`

The title of the first menu. You may specify an empty string if you do not want to add an initial menu item.

`pullDown`

<doc://com.apple.documentation/documentation/Swift/true> if you want the receiver to display a pull-down menu; otherwise, <doc://com.apple.documentation/documentation/Swift/false> if you want it to display a pop-up menu.

## Return Value

An initialized `NSPopUpButtonCell` object, or `nil` if the object could not be initialized.

## Discussion

This menu item is assigned the default pop-up button action that displays the menu. To set the action and target, use the setAction: and setTarget: methods of the item’s corresponding [`NSMenuItem`](/documentation/AppKit/NSMenuItem) object.

This method is the designated initializer of the class.

## See Also

[`-  initWithFrame:pullsDown:`](/documentation/AppKit/NSPopUpButton/init(frame:pullsDown:))

Returns an `NSPopUpButton` object initialized to the specified dimensions.



---

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)