Popup menus in Cocoa are called alerts. There are two kinds of alerts in macOS: alert panels and alert sheets. This video explains alert panels—how to create them and make them appear in macOS apps.
- [Instructor] In Cocoa, pop-up menus are called…alert panels and alert sheets.…Let's start by looking at an alert panel.…So I'm going to drag a push button…on to the middle of the screen, just right there,…and I'm going to connect this using the assistant editor,…so I'm going to option click AppDelegate.swift,…and then simply right click and drag from the button…into my code between lines 15 and 16,…set the connection to action, name this didClickButton,…and then hit connect.…
Go back to the standard editor,…and then into AppDelegate.swift.…So inside of didClickButton, I want to spawn…this alert panel, so I'm going to put…my cursor in between the curly braces,…and I'm going to define my alert,…and I'm going to create a new NSAlert.…On the next line, I'll set the message text,…so alert.messageText, and then I'll set…the message text property to a string.…Usually an alert says you can't do something…that you're trying to do, or maybe you did something…successfully, and you're getting a…notification for it, and then we show it.…
- Installing your development tools
- Working with Xcode and the MVC pattern
- Creating basic interactions
- Creating delegate classes
- Building a user interface
- Laying out the UI
- Working with data and table views
- Binding data objects to the UI
- Debugging your app
- Distributing the app
Skill Level Beginner
1. Get Started
2. Core Cocoa Skills
4. Create User Interfaces
5. Arrange User Interfaces
6. Use Data Controls
7. Debug and Troubleshoot
8. Distribute an Application
9. Finishing Touches
Create full screen apps1m 51s
Next steps1m 21s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.