Skip to Content
Cocoa Programming for OS X: The Big Nerd Ranch Guide
book

Cocoa Programming for OS X: The Big Nerd Ranch Guide

by Aaron Hillegass, Adam Preble, Nate Chandler
April 2015
Intermediate to advanced
556 pages
17h 47m
English
Big Nerd Ranch Guides
Content preview from Cocoa Programming for OS X: The Big Nerd Ranch Guide

Improving Scattered: Time Profiling in Instruments

Open the Scattered project from the previous chapter and find addImagesFromFolderURL(_:) in ViewController.swift. Find the allowedFiles variable, which is used to limit the number of files opened to ten. Remove all traces of allowedFiles and run the application.

You should see the Scattered app’s icon bouncing in the dock for several seconds. When the window appears, all the images will already have been animated to their destinations. It looks like loading the images is blocking the main thread, which is a poor user experience. You may have a pretty good idea that the problem is related to loading images, since you just removed the limit, but let’s prove it.

Introducing Instruments ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Cocoa with Objective-C, 4th Edition

Learning Cocoa with Objective-C, 4th Edition

Paris Buttfield-Addison, Jonathon Manning, Tim Nugent
Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Stefan Kaczmarek, Brad Lees, Gary Bennett, Mitch Fisher

Publisher Resources

ISBN: 9780134077130Purchase book