mikeash.com: just this guy, you know?

NSBlog
RSS feed (full text feed)

c c++ cocoa code codeinjection corefoundation evil(2) fridayqna(3) garbagecollection hack(7) magic nib nscell objective-c objectivec(2) pyobjc python sourcecode

Showing entries tagged "hack". Full blog index.

Tags: fridayqna corefoundation hack evilIt's time for another friendly edition of Friday Q&A. For my last Friday Q&A, I talked about MAZeroingWeakRef and how it's implemented for pure Objective-C objects. For this one, I'm going to discuss the crazy hacks I implemented to make it work with toll-free bridged CoreFoundation objects as well.
(Read More) 4 comments

Introducing MAZeroingWeakRef at 2010-07-16 20:19
Tags: objectivec code hack sourcecodeI'm extremely excited to announce a new library for Cocoa and Cocoa Touch development: MAZeroingWeakRef. In short, it's a library which allows zeroing weak references to be used in retain/release Cocoa code. This has all sorts of uses and should make retain/release coding less painful. While I discussed this in detail in my Friday Q&A post this week, I also want to make a separate announcement for people who don't want to read through all of the horrible details.
(Read More) 3 comments

Friday Q&A 2010-07-16: Zeroing Weak References in Objective-C at 2010-07-16 20:18
Tags: fridayqna objectivec garbagecollection hackIt's that time of the biweek again. For this week's Friday Q&A, Mike Shields has suggested that I talk about weak references in Objective-C, and specifically zeroing weak references. I've gone a bit further and actually implemented a class that provides zeroing weak references in Objective-C using manual memory management.
(Read More) 41 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.

Tags: fridayqna codeinjection hack evilWelcome back to another exciting Friday Q&A.; This week I'll be taking Jonathan Mitchell's suggestion to talk about code injection, the various ways to do it, why you'd want to, and why you wouldn't want to.

Hacking C++ From C at 2006-08-03 00:00
Tags: magic c c++ hack For a long time, LiveDictionary used deeply unwholesome methods to do its work. Version 1.2.5, just released, now uses nothing but public methods. This means vastly improved stability, but it also means that LiveDictionary's evil WebKit text grabber, once considered the app's crown jewels, is no longer useful. I'm going to use it as an object lesson on how to do evil things with C++ applications from pure C.

Custom NSCells Done Right at 2006-04-06 00:00
Tags: nscell nib hack Anyone who's done enough Cocoa has eventually run into the nightmare that is subclassing an NSCell. While it looks simple enough, actually getting an Interface Builder-generated control to use your NSCell subclass is effectively impossible. You either have to use CustomViews in IB, write an IBPalette, or do a whole lot of tedious and error-prone manual copying of attributes to get everything from the IB-provided cell into your own.