Objective-C hidden features
2014-03-14 18:29:39.382311+00 by Dan Lyke 2 comments
I don't need to duck into iOS or Objective-C that often, but Stack Overflow: Hidden features of Objective-C looks like fascinating reading.
2014-03-14 18:29:39.382311+00 by Dan Lyke 2 comments
I don't need to duck into iOS or Objective-C that often, but Stack Overflow: Hidden features of Objective-C looks like fascinating reading.
comments in ascending chronological order (reverse):
#Comment Re: made: 2014-03-14 22:54:00.639028+00 by: markd
It's a pretty out of date list. +poseAsClass got removed in the new Objective-C runtime a long time ago. Isa twiddling has become verboten in the iOS 64-bit runtime (thanks to the non-pointer isa - http://www.sealiesoftware.com/...bjc_explain_Non-pointer_isa.html - kind of a cool set of optimizations given all the extra address bits lying around). And some of the techniques that used to be pretty easy (like faking multiple inheritance with forwardInvocation:) are now more tedious than useful given the somewhat stricter compiler we have today.
If you're interested in Objective-C runtime canoodling, I have a seven-parter over at the Big Nerd Ranch blog. http://blog.bignerdranch.com/2...racket-part-1-open-for-business/
And pretty much anything by Mike Ash (distinct from the regular-expression Mike Ash) is worth reading, such as his objc topics. Here's his ObjC jazz https://www.mikeash.com/pyblog/?tag=objectivec
#Comment Re: made: 2014-03-15 00:01:11.904412+00 by: Dan Lyke
Cool! Thanks!
I don't have particular applications for the class posing stuff (and it sucks that it's been deprecated, because I like places where I can only write code once), but the one thing I did like about Objective-C was that I could easily add members to existing classes without subclassing.
Of course my strategy generally is "get it into a generic environment ASAP and then write cross-platform", so usually it's either getting standard widget messages into my core controller, or gimme a canvas and let me draw on it and send me mouse events.