Posts written by Mark Dalrymple
Jun
13
2013
Last time we took at look at some of the data you can ask an object and its class about, stuff like a the signature of a method, as well as an application using NSInvocation. This time it’s a look at some of the methods you can use to interrogate an object.…
Jun
6
2013
Last time we took a look at the motivations behind Objective-C message sending. It’s a layer of indirection that lets one chunk of code treat other, perhaps unrelated, chunks of code in a uniform manner. “I have a pile of views here, I shall draw them all with -drawRect:, and I don’t care if the views are Buttons, Sliders, or World Maps.” There’s a loop that hits a collection and sends the same message to a bunch of objects:
for (NSView *view in visibleviews) {
[view drawRect: view.bounds];
}
Objective-C performs this magic by having a collection associated with each object.…
May
23
2013
What is something that we use every day as a Mac or iOS programmer? Objective-C. What do we use every day in Objective-C? Those square brackets. How many times a day do you type something like this?
[someObject doSome:stuff for:reasons];
Ever wondered what’s really happening inside those square brackets?…
May
17
2013
So. That Clash of the Coders Thing. Kind of nice being able to flex mental muscles over a 72-hour sleep-deprived Dr Pepper-infused period of time, performing acts of violence upon the Objective-C runtime, UIApplication, and the layer stack. It was a blast being able to use all my platform knowledge with the express purpose of subverting it.…
May
2
2013
I was hanging out on the #macdev IRC channel on Freenode the other day when someone asked a question: “static has different meanings based on the context it is placed in, right?”. Indeed, it has different meaning. And yet it’s the same.…
Apr
18
2013
Instruments is a cool tool. There is a lot it can do beyond “simple” things like profiling your application’s execution time or finding your memory leaks. It can also give you holistic views of the activity on a device, such as power consumption.…
Apr
11
2013
You can find all sorts of interesting and useful stuff in Apple’s header files. Don’t be afraid to explore them. I usually troll through the headers when a new major SDK version comes out (like IOS 7 probably will be this year) to see what’s new.…
Apr
5
2013
If anyone would have told me 30 years ago that I’d actually enjoy writing, that I’d look forward to writing something new, that I’d earn part of my living from the act of writing, I would have sent them straight to a psychiatrist.…
Mar
28
2013
Just got back from the DC area, where some fellow Ranchers and I went to CocoaConf. If you’re not familiar with CocoaConf, it’s a traveling technical conference for Mac and iOS developers. I like to call it a peripatetic conference, where Dave Klein (who runs the conference) travels around with his family to different cities and puts on a great conference.…
Mar
21
2013
Simple questions can be fun. A friend in the Pittsburgh CocoaHeads said “Hey MarkD. We’re having a discussion at work on the right way to iterate through an NSArray. One dude said to just use the for...in syntax, and the other said that we should always use the block based iteration form.…
← Older posts