Posts Tagged ‘software development’

iPhone OS 3.0 Adoption Rate

Tuesday, June 23rd, 2009

Tapbots on iPhone OS 3 adoptions among their active users:

We’re currently running at an overall 75% upgrade rate which is pretty insane considering the number of devices and the fact that its only been 5 days.

Early iPhone 3G S OpenGL test results

Saturday, June 20th, 2009

Early iPhone 3G S OpenGL Test Results from Daniel Pasco over at Black Pixel:

the iPhone 3G S ran about twice as fast as the 2g Touch in every test

The iPod touch 2G was the previous speed champion of the iPhone OS X hardware.

Trust, hostility, and the human side of Apple

Monday, June 15th, 2009

Trust, hostility, and the human side of Apple:

It was a giant middle finger to iPhone developers. And that’s the closing impression that Apple gave us for WWDC. Clearly, they had absolutely no interest in fielding even a single question from the topic that we have the most questions about.

How to manipulate a developer

Monday, April 20th, 2009

Hint: We like being manipulated, as long as it’s being manipulated correctly.

inessential.com: How to manipulate me (or, Tuesday Whipper-Snapping)

Imagine you’re in my shoes: you’re me, for a minute. Think about feature requests, for example—you have a list several hundred items long of really, really good ideas. You’ve heard pretty much everything multiple times, though now and again you do hear new ideas. Which just makes the list longer!

Keeping optimal autorelease pools

Saturday, April 4th, 2009

Martin Pilkington on autorelease pools:

However, a problem arises when you’re creating a lot of objects at once. The obvious solution is to initialise and release objects by hand in this case, but sometimes it isn’t possible. A lot of objects returned by Cocoa methods are autoreleased (by convention any object returned by a class method (other than +new or +alloc) should be autoreleased).

This is a good practical example of autorelease pool manipulation, including numbers showing before and after.

Coding tips for new iPhone developers from a new iPhone developer

Monday, February 2nd, 2009

If any of these seem wrong, please comment!

  • The Objective-C syntax is strange. It’s really not that hard, though, especially once you realize that part of the reason for the design was to make Objective-C a strict superset of C. That means that the C code you throw at it will compile and means the same thing under C as Objective-C.
  • Use NULL for pointers (void*) and nil for instances (NSObject*). They’re defined the same, this is just convention.
  • Use properties and stay sane. You can leave the dot syntax alone if you like (though I like it), but it’s worth using properties anyway because it forces you to document the assignment mechanism you’re using.
  • Method names that return an object where the name does not contain init must not require the object be released.
    • If you’re writing the object, this means you’re probably calling retain and autorelease.
    • If you’re using the object, this means it is probably already calling autorelease. If you release the instance yourself, you’ll crash later.
  • Use allocinit on the same line.
  • If you’re going to autorelease an object, do it at immediately on creation rather than later: [[[Object alloc] init] autorelease].
  • Sure, you can avoid using autorelease. Sure, it would perform “better”. But can you quantify “better”? Is it significant to you? If it isn’t, stick with using autorelease. When you follow the rules, you idiotproof yourself. See the probably in the previous group of points? Stick with the rules and it’s basically an “always.”
  • Remember that debugging is harder than writing code. While you can write something like textView.text = [NSString stringWithFormat:@"%@: %d", [b field:@"test"], [a precision]]; you are going to have to debug it later. In most cases, you’ll benefit from assigning results to temporary variables before passing them through to Cocoa.

I’m going to write about the major device vs. simulator differences I’ve noticed another time, but there’s one worth mentioning now: CGSize size = [string sizeWithFont:font] with a nil string will return a zero point on the desktop, but will return a random value (stack, maybe?) on the device itself. Check for nil first, as in CGSize size = string ? [string sizeWithFont:font] : CGSizeZero.

Multiple virtual pages in a UIScrollView with just 2 child views

Saturday, January 24th, 2009

Matt Gallagher posts on multiple virtual pages in a UIScrollView using just 2 child views:

The UIScrollView and UIPageControl in Cocoa Touch allow for user interfaces with multiple panning pages. The sample project that Apple provides (PageControl) keeps all child views for every page in a lazily loaded array. I’ll show you how you can implement this using just two child views, no matter how many virtual pages you wish to represent.

Caveat emptor on this technique, I suppose. You are going not going perfectly along Cocoa Touch’s grain. Probably best used when dealing with a large number of views.

I actually tried something like this before settling on a more basic approach like Apple’s PageControl sample code. But I ran into a problem which I thought was related, but turned out not to be: UITextView wouldn’t update when offscreen.

Turns out Matt has a solution to that, too:

These parts of the program exist because UITextView (used for the “Some text for Page X” display) don’t update if they are offscreen (in this case: in an offscreen page of the UIScrollView). This behavior isn’t a problem when the UITextView remains offscreen but becomes especially annoying when it is brought onscreen and still doesn’t update.

What a weight off my mind that is!

Full project and source included. Thanks Matt.

“My” vs “Your”

Friday, January 23rd, 2009

Small but nice iPhone application wording tip: “My” vs “Your”. I’d have fallen for that one for sure, but he’s right.

Setting up Subversion 1.5 on Xcode

Tuesday, January 20th, 2009

These instructions are for the Collabnet build, but you can use MacPorts build instead by replacing the path /opt/subversion/lib/ with /opt/local/lib/.

Lemon Team’s blog » Blog Archive » Setting up Subversion 1.5 on Xcode

Wil Shipley on the iPhone App Store: Let the Market Decide

Tuesday, September 23rd, 2008

Wil Shipley on the iPhone App Store. This is mostly the same thing I’ve been thinking, with the exception that I’d have removed the $999 I am Rich/I’ve been scammed! application without apology or even reason, even if the App Store offered some sort of price warning.