Join Simon Allardice for an in-depth discussion in this video Using assertions, part of Cocoa Essential Training.
One useful technique for troubleshooting in Cocoa is using Assertions.…Assertions help you find bugs earlier than you would otherwise.…At a particular point in your code you can add Assertions.…You assert something, you say at this point something should be true.…A variable should be greater than 1,000, or a string should be a certain…value, an object should be not nil.…And if what I have asserted is false, that's a problem.…So here I have a very simple method called doSomething being called by a button click.…It itself is calling this complicatedCalculation method.…
Now I might imagine there's an awful a lot going on here, but what I'm going…to do is after our for loop, I'm really hoping that the variable foo is equal to 5000.…In fact, that's what I want to assert.…And I create assertions like this with a single call to NSAssert.…It's a very simple line, it looks like a function call, and you can't think of it…like that, but technically it's a macro, and that's very useful for a reason…I'll explain in a moment.…
- Installing the tools
- Creating your first app
- Adding basic interactions
- Understanding the Cocoa application life cycle
- Creating custom controller classes
- Creating alerts
- Understanding delegation
- Working with buttons, text fields, sliders, and more
- Using layout and data views
- Adding and editing toolbars
- Using key-value coding
- Binding objects
- Debugging code
- Distributing an application
- Creating icons and full-screen apps
Skill Level Beginner
1. Getting Started
2. Core Cocoa Skills
4. Creating User Interfaces
5. Arranging User Interfaces
6. Using Data Controls
7. Debugging and Troubleshooting
8. Distributing an Application
9. Finishing Touches
Creating full-screen apps6m 43s
Final thoughts4m 10s
- 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.