mikeash.com: just this guy, you know?

NSBlog
RSS feed (full text feed)

accessors autorelease(2) bug c++ chemicalburn cocoa(11) fridayqna(5) hack init initializer iphone leopard(2) objective-c(15) performance(4) pyobjc python rant singleton stl super

Showing entries tagged "objective-c". Full blog index.

Tags: cocoa objective-c accessorsIt's Black Friday, and that means it's time for another Friday Q&A. Today I'm going to talk about the use of accessors in Objective-C init/dealloc methods, a topic suggested by Jon Trainer.
(Read More) 19 comments

Friday Q&A 2009-11-20: Probing Cocoa With PyObjC at 2009-11-21 02:44
Tags: cocoa python pyobjc objective-c hackIt's another Friday and time for another Friday Q&A. This week, fellow Amoeba Jeff Johnson suggested talking about using Cocoa from the command line using Python and PyObjC.
(Read More) 7 comments

Friday Q&A 2009-10-02: Care and Feeding of Singletons at 2009-10-02 15:59
Tags: fridayqna cocoa objective-c singletonIt's time for another Friday Q&A. I hope everyone who had a chance to go to C4 had a good time and is back home safe and sound. This week I'm going to discuss singletons, both how to make them and when to use them, as suggested by Jon Trainer.
(Read More) 20 comments

Friday Q&A 2009-05-22: Objective-C Class Loading and Initialization at 2009-05-23 00:37
Tags: fridayqna objective-cWelcome back to another cromulent Friday Q&A. After taking a few weeks off I intend to resume the regular schedule. We'll see how far that intention takes me, but I'm hopeful. This week I'm going to take Daniel Jalkut's suggestion to discuss class loading and initialization in Objective-C.

Tags: fridayqna objective-cWelcome back to another exciting Friday Q&A. This week I'm going to continue the series on the Objective-C runtime. Yuji Tachikawa suggested talking about how @dynamic properties work in CoreData and I'm going to take that and expand it to talk about message forwarding in general.

Tags: fridayqna objective-cWelcome back to another Friday Q&A. This week I'd like to take Joshua Pennington's idea and elaborate on a particular facet last week's topic of the Objective-C runtime, namely messaging. How does messaging work, and what exactly does it do? Read on!

Tags: fridayqna objective-cWelcome back to another Friday Q&A, on another Friday the 13th. This week I'm going to take Oliver Mooney's suggestion and talk about the Objective-C runtime, how it works, and what it can do for you.

Tags: cocoa objective-c super init initializerOne of the longest ongoing controversies in the Cocoa community is how to write your init methods. More specifically, how to properly call your superclass's initializer. In the hopes of putting this controversy to rest, I want to walk through the right way to write an initializer and exactly why this is the right way.

Tags: performance cocoa objective-c iphoneI finally got a chance to run my performance comparison code on an iPhone, so we can see just how much horsepower this little device has. I still am not able to load my own code onto the device myself, so I want to thank an anonymous benefactor for adapting my code to the new environment and gathering the results for me.

Tags: performance cocoa objective-c leopardBy popular demand, I have re-run my Performance Comparisons of Common Operations on the same hardware but running Leopard.

Leopard: First Impressions at 2007-11-30 23:12
Tags: leopard cocoa objective-c rantLeopard's been out for a while now and brings with it a lot of interesting new tools for the Mac programmer. I've had the chance to work with some of them and want to offer my opinion on how they've worked out.

Tags: performance objective-c cocoa We all know that premature optimization is the root of all evil. But a recent conversation brought to mind that we often don't really know the runtime costs of the code we write. While we should be writing foremost for correctness and clarity, having an idea of these speeds is good, especially when we get it into our heads that some operation is much more costly than it really is. With that in mind, I compiled a list of common Cocoa operations and how much time they require at runtime.

More Fun With Autorelease at 2007-02-08 00:00
Tags: autorelease bug cocoa objective-c I just hit a subtle but commonly known bug for the first time. I thought I'd share my fun with the world. Everybody reading this blog should know about autorelease pools and how they work in Cocoa. As everybody knows, every time you go through the event loop, Cocoa blows away the old pool and makes a new one for you, so that all of your autoreleased objects go away and your new ones go into a fresh pool. That way you never build up more objects than get produced during a single event loop cycle.

Using Evil for Good at 2006-07-14 00:00
Tags: cocoa objective-c c++ stl chemicalburn People who know me as a programmer probably know that I am a great hater of C++. As someone who does a lot of Cocoa, this extends naturally into hating Objective-C++. But I made good use of Objective-C++ in ChemicalBurn and I thought I'd share.

Autorelease is Fast at 2006-06-07 00:00
Tags: autorelease performance cocoa objective-c If you've done much Cocoa programming, you've probably run into a situation where you needed to create a local autorelease pool because of some sort of loop. And you've probably run into advice telling you not to create and destroy the pool for every iteration, because that would be slow. I never believed that it could be significant, and I finally took the time to test it today. What's the verdict? Just as I thought, making autorelease pools is really fast.