Home > Blogs > Big Nerd Ranch

Big Nerd Ranch

RSS FeedSubscribeRSS details

Ask Big Nerd Ranch: Why do Fragments Matter in Android Application Development?

The experts at Big Nerd Ranch answer the question, "Why do fragments matter in Android application development when you can develop apps without using them?"

Continue reading...

By Big Nerd RanchAugust 13, 2013
Topics: Programming

Ask Big Nerd Ranch: Atomic Properties

Alex Silverman answers a question about atomic properties.

Continue reading...

Ask Big Nerd Ranch: Blocks in Objective-C

Adam Preble answers a question about blocks.

Continue reading...

Ask Big Nerd Ranch: Rotating an iPhone View Around a Point

Brian Hardy answers a question about view rotation.

Sample code for this article is available in the Big Nerd Ranch github repository. The sample application demonstrates several techniques illustrated here, and works on iPhone or iPad.

Q. On iPhone OS, how can I rotate a view around an arbitrary point?

A. By default, views in Cocoa Touch (and Cocoa) are configured to rotate around their center point. While this is commonly useful (think of a UIActivityIndicatorView), often you will want to use a point other than the center. There are (at least) two ways of doing this. You can change the anchorPoint property of the view's layer. Alternatively, you can wrap the view in a superview, with the superview's center located at the point you want to rotate around. In either case, the mechanism for rotation is the same. Both techniques are discussed here.

Continue reading...

By Big Nerd RanchMay 20, 2010
Topics: Programming

Ask Big Nerd Ranch: Adding Python Scripting to Cocoa apps

Q: How would one go about writing a Python plugin system for a Mac application written in Cocoa?

A: Implementing a plugin system of any kind consists of exposing some internal data or functions of an application to an external piece of executable code, which in this case is a Python script. Doing so allows for users to extend an application's functionality beyond what the application's author intended or conceived. We'll take a look at how to execute Python scripts from within a Cocoa app, and we'll discuss how to structure an application to allow for flexible scriptability.

Continue reading...

By Big Nerd RanchMarch 26, 2010
Topics: Programming

Ask Big Nerd Ranch: Detecting That QuickTime Has Exhausted Its Stream

Jeremy W. Sherman answers a question about QuickTime.

Q. If a QTMovie is loading audio from the web and the stream stops, how can I detect whether the QTMovie stopped?

A. Suppose you have a QTMovieView playing a QTMovie. The QTMovie is loading media from the Web. Now, suppose your network connection drops.

What happens next depends on the structure of the movie file itself. The movie file might contain the data itself, or it might reference a broadcast stream.

Continue reading...

Ask Big Nerd Ranch: Retain Counts for Cocoa and iPhone Programmers

In the first installment of Ask Big Nerd Ranch, Juan Pablo Claude discusses a subject that causes much confusion among new Objective-C programmers. Juan Pablo Claude is the co-author, with Aaron Hillegass, of the forthcoming More Cocoa Programming for Mac OS X.

A question from Zack Brown: "When using an object in Objective-C, why doesn't

[self dealloc]
get called when the object is released?"

Continue reading...