Filed under: Features, How-tos, Developer, iPhone, iPod touch
It has been a while since the last iPhone Dev 101 post (and I must apologize for that — sometime life can get in the way of different things, and this was one of those times). In this Dev 101 post, I want to take you through a few of my favorite resources for Cocoa/iPhone development. Some of these resources are books, while others are sites, but all of the resources are valuable to up and coming developers (and experiences developers) alike.
Books
Some books are just invaluable and couldn’t be replaced with another. Aaron Hillegass’ Cocoa Programming for Mac is just that book. Currently in it’s 3rd edition, the book gives you much of the Cocoa programming information that you need to program for both the Mac and iPhone. There are only a few subtle differences in programming for these platforms, namely the use of the Cocoa Touch. If you ever have the chance, going to one of the Big Nerd Ranch Cocoa programming classes gives you the ability to learn Cocoa hands-on.
Another title that is useful to beginning iPhone developers is the Beginning iPhone Development book. This book has a useful approach to stepping into the world that is programming on iPhone. It talks about numerous topics including UI design, Quartz, and OpenGL. Also covered in the book are APIs like CoreLocation and interfacing with the camera.
If you already know Cocoa and a little about iPhone development, Erica Sadun’s iPhone Developer Cookbook is a great jumping off point to start development. She assumes, however, that you already understand Cocoa.
Continue reading to learn about more valuable books, websites, and resources for iPhone/Mac developers.
Continue reading iPhone Dev 101: Useful Cocoa Development Resources
TUAWiPhone Dev 101: Useful Cocoa Development Resources originally appeared on The Unofficial Apple Weblog (TUAW) on Wed, 25 Mar 2009 10:00:00 EST. Please see our terms for use of feeds.
Read | Permalink | Email this | Comments
(Via The Unofficial Apple Weblog (TUAW).) Original Link: iPhone Dev 101: Useful Cocoa Development Resources
I’ve spent a lot of time fighting with certificates, keys, and provisioning profiles in the time I’ve been working on iPhone apps for clients and myself. I finally figured out how to make it easy to manage multiple sets of certs/keys (i.e. one per client). Even if you are only working with a single set, though, it’s still helpful to keep iPhone stuff separate from the rest of your keychain. I’m going to approach this as if you are starting from scratch, but it’s easy enough to fix if you have already set up certs and keys and it should be pretty obvious how to go about it from these instructions.
First off, you need to know your tools. Keychain Access is where all of your certificates and keys (and passwords, and a variety of other things irrelevant to this discussion) live. Xcode, iPhone Configuration Utility, and iTunes all deal with the same store of provisioning profiles, but only the configuration utility is actually good at it. Download it from Apple right now and install it. When working within the iPhone Configuration Utility (hereafter referred to as iPCU) neither iTunes nor Xcode should be running since they will need to be restarted anyway to see any changes you make.
Before anything else, you need to download and install the WWDR intermediate certificate if you haven’t already. Get it here and open it in Keychain Access (hereafter referred to as KA). You’ll want to install it in either the login or System keychains (it doesn’t matter much). Now that you’re in KA, create a new keychain (File menu) and name it for the particular program portal you’re working with at the moment. I recommend saving it in the default location, ~/Library/Keychains, but if you save it somewhere else just make sure you remember where. You’ll need to set a password for it, and you can choose to be as secure or insecure as you like about it; the certs/keys would otherwise be in the login keychain, which is open by default as long as you are logged in, so anything is more secure than the alternative. Follow the program portal instructions for creating a Certificate Signing Request (CSR). Notice that creating the CSR created a private key in the login keychain in KA. Drag that private key to the new keychain you just created (the client keychain). Upload the CSR and go through the process of getting a developer certificate and a distribution certificate. (You’ll need both eventually, and you can use the same CSR for both; if you don’t, a new private key may be generated for the second CSR, and you’ll need to drag that from the login keychain to the client keychain as well.) Install the certificates in the client keychain rather than System or login.
When you are done with this process, you should have a private key (maybe two — see above), a developer certificate, and a distribution certificate in the client keychain. I like to set the keychain to lock after a period of inactivity so Xcode asks me for a password when it codesigns and I know it’s doing what I expect. Remember where you saved the keychain file? Make a backup copy of it now and put it somewhere safe (source control, offsite backup, optical media, whatever). If this is the only program portal you deal with, you’re done. If not, right-click (or ctrl-click) on the client keychain and choose Delete Keychain “[whatever]“.
IMPORTANT: Be sure to choose “Delete References” and not “Delete References & Files”!!! If you choose the wrong one, you will be glad you made that backup copy. KA will close the keychain, but you can open it again when you are working with that program portal again. You can then repeat the process for any other program portals that involve you.
Clearly, if someone else has created the distribution certificate you need to use you will need to get the cert and private key from that person instead. You can still put them in the client keychain once you have them, of course. If you have already been dealing with certs in your login keychain, you might have lots of private keys lying around and no good way to tell which key goes with which cert. I feel like there should be an easy way to tell, but I haven’t found it. Instead, create a new keychain and put all but one of the private keys into it, leaving one in the login keychain, then lock that temporary keychain (i.e. click its lock icon in KA). Build something in Xcode that requires the codesigning cert you are testing and see whether it asks for a keychain password. If not, the key you left in the login keychain goes with that cert; otherwise, switch keys and try again. (You can be cleverer about it by locking away half the keys so it’s a binary rather than linear search, plus you can test more than one cert at a time, but I leave that as an exercise for the reader.) Eventually you will be able to associate keys with certs and put them in their appropriately separate keychains.
Next up, we’ll look at provisioning profiles. There are three kinds of profiles: development, ad hoc, and app store. Both ad hoc and app store are considered distribution profiles, but they behave differently. In fact, ad hoc profile behave more like development profiles than app store profiles. (Note: there may be still yet another profile type for enterprise distribution, but I have no experience with that.) A development or ad hoc profile permits an app with a particular app ID (or ID prefix) to be installed on any of a set of physical devices when signed by one of a set of certificates. For ad hoc, it’s only one certificate: the distribution certificate. A device must have the provisioning profile installed on it to run the app, which Xcode does automatically for development profiles. I’ve had a lot of trouble with ad hoc profiles, and I’m still not confident I can get things working 100% of the time, but I have a better grasp on it than I used to. For the sake of my own sanity I am going to assume that you have figured out how to set up app IDs, devices, and provisioning profiles in the program portal.
There isn’t a whole lot more to it, really, except keeping track of which profiles belong to which portals if you are dealing with more than one. I recommend naming the profiles carefully when you create them or, failing that, keeping a text file listing what each profile identifier is for. Whenever you have a new profile you’ll want to use to build an app, I recommend installing it in iPCU rather than Xcode. It seems to work more dependably for me. Also, if it’s an ad hoc profile, I recommend installing it on the device using iPCU rather than iTunes if at all possible. If you use the multiple certs/keys keychains trick, I’d like to tell you that there is a similarly good way to manage provisioning profiles; I don’t know of one. The good thing, though, is that Xcode is smart enough to check the currently open keychains when presenting you with a list of provisioning profiles in a project’s (or target’s) build settings. If the cert for a particular profile is not available (even if the keychain is locked, its contents are available as long as KA has it listed), it will be grayed out with a message saying <matching certificate identity with private key not found in login keychain>. No matter how many provisioning profiles you have installed from other program portals, only the ones related to the certs and keys you have open will be available, which helps avoid silly mistakes.
I hope this is helpful to someone out there. I know I wish I’d known this stuff when I started developing for the iPhone. Enjoy!
(Via Ruby Discoveries and Idioms.) Original Link: Managing iPhone Development
Measuring the Design Process: “Both John Gruber and Buzz Anderson have commented on the experiences of former design lead at Google, Doug Bowman. Doug’s observation is that at Google, every design decision must be backed by data. In essence, you must prove you’re right. The post is quite short, but it resonates with me because I’ve seen the same thing at other companies…”
(Via Theobroma Cacao.)
Filed under: iPhone, SDK, iPod touch
Tuesday’s iPhone OS 3.0 announcement has left the interwebs even more iPhone-obsessed than usual. If you find digging through all this information overwhelming (or, if like me you were out of town when OS 3.0 was announced), check out this round-up of news, opinions and videos. The only thing missing is a beta copy of OS 3.0 and that’s already floating around various torrent sites.
If that’s not enough, be sure to check out our continuing iPhone OS 3.0 coverage.
Watch the OS 3.0 presentation — Were you left off the invite list too? Check out the video in HD or SD at the link above or in iTunes [iTunes link] as a video podcast.
Engadget’s iPhone OS 3.0 Hub — Engadget has a whole page dedicated to their furious and hands-on iPhone OS 3.0 coverage, including this video walkthrough.
What Apple Didn’t Announce — Apple’s iPhone OS 3.0 presentation didn’t answer every question or address every iPhone issue. Our old friend David Chartier tackles what was left out.
SDK 3.0 brings more NDA fun — Much to the chagrin of many iPhone devlopers, the NDA is back for SDK 3.0. At Arstechnica, our pal Erica takes on what this means for developers. Let’s just hope the NDA is lifted as soon as 3.0 is officially released.
OS 3.0 Screenshot Pr0n — Pfft, what NDA? iLounge has put together a great gallery of iPhone OS 3.0 screenshots, showing off what’s new and improved. Love it.
iPhone OS 3.0 vs. Android — Lifehacker has a pretty neat comparison of features that are currently avaialable in the iPhone 2.21, stuff that’s coming in OS 3.0 and what’s available and coming for Android. As someone who has spent a LOT of time using both the iPhone OS and the T-Mobile G1, I’d just add that hardware and UI is actually just as important as “features” when comparing the two platforms. Right now, the iPhone absolutely cleans Android’s clock — despite having fewer “features” — because the hardware is better (that G1 keyboard is terrible), the UI is more thought-out and the third-party software is better by leaps and bounds. (hat tip, Gruber)
Future iPod/iPhone models referenced in latest betas — The latest iPhone OS 3.0 SDK includes references to future iPhone and iPod models (3,1) and two other unknown devices.
TUAWiPhone 3.0 Friday roundup originally appeared on The Unofficial Apple Weblog (TUAW) on Fri, 20 Mar 2009 16:00:00 EST. Please see our terms for use of feeds.
Read | Permalink | Email this | Comments
(Via The Unofficial Apple Weblog (TUAW).) Original Link: iPhone 3.0 Friday roundup
Here’s the post.‘ It basically goes like this:’ Apple has said it is increasing its embedded device list this year.’ Ten-inch touch screens seem to be flying around Asia en route to Apple for late Summer.’
If there is a tablet with higher resolution/independence, developers are going to need a few months to tweak their apps for launch.” What if that $20 minimum Premium App Store happens to be for higher resolution apps?
Also, ARM’s new line of Cotex A8 architecture processors are tablet-worthy.’
Plus, I need something to look forward to…So here’s why we might see a tablet intro tomorrow.
Speaking of which, we’ll have the 9to5mac LivePanel open for the iPhone 3.0 Event.’ Stop by to see all information sources in one page.
‘
“
iPhone OS 3.0 is coming, preview on March 17th: “
Filed under: Cellphones
iPhone OS 3.0 is coming, preview on March 17th originally appeared on Engadget on Thu, 12 Mar 2009 12:06:00 EST. Please see our terms for use of feeds.
Permalink‘|’Email this‘|’Comments“
(Via Engadget.)
Enable SpeedStep support on any capable Intel CPU: “As described on Wikipedia, SpeedStep ‘is a trademark for a series of dynamic frequency scaling technologies (including SpeedStep, SpeedStep II, and SpeedStep III) built into some Intel microprocessors that allow the clock speed of the processor to be dynamically changed by software. This allows the processor to meet the instantaneous performance needs of the operation being performed, while minimizing power draw and heat dissipation.’
Apple implements SpeedStep on certain Macs, but not all of them (and if you’ve built your own Mac, you may not have any SpeedStep support). Here’s how to enable SpeedStep on any Mac: Use the xnu speedstep kernel extension. Just download IntelEnhancedSpeedStep.kext.1.4.5.zip, then copy IntelEnhancedSpeedStep.kext into /System/Library/Extensions. Don`t forget to repair permission (in Disk Utility) when done, then reboot your…





“
(Via MacOSXHints.com.)
TUAW Bookshelf: iPhone in Action: “
Filed under: Analysis / Opinion, iPhone, iPod touch, TUAW Bookshelf

I’ve never found book reviews to be terribly helpful — technical book reviews even less so, as how one learns differs from person to person. Some iPhone devs out there learned simply by poring over Apple’s copious documentation. Others have been poking at the iPhone’s innards since pre-SDK days, learning as they went from forums and good old hacking. But once the NDA lifted, the floodgates of iPhone dev books opened.
Each book and each publisher has a different angle both in content and presentation. Each book may appeal to different people and different learning styles with different backgrounds (not to mention the numerous sites, blogs and video resources out there beyond what Apple provides). Over the course of 2009 we’ll be taking a look at some books in a new series called TUAW Bookshelf. We won’t just be covering developer resources, either. There’s a wide world of Apple-related reading out there, so stay tuned as we pull from our personal libraries and share our thoughts on what’s available.
To kick things off I read iPhone in Action by Christopher Allen and Shannon Appelcline, published by Manning. I wound up reading this first because one of the authors threw a few copies at me while at Macworld (sorry, I don’t know who you are and I can’t seem to find your business card!). We’ve got a few to give away, but look for that in another post this month.
iPhone in Action is designed to be a soup-to-nuts intro to almost everything you can develop for the iPhone. This includes web apps, which was the book’s main focus until the SDK was announced while they were writing. I don’t think shifting focus to the SDK is a bad thing, and as near as I can tell it didn’t hurt the content. In fact, I thought this book would make an excellent primer to Apple’s mobile platform efforts. Having taught technology for six years, I can say this is the book I’d use for a 100-level course in developing for the iPhone. I’m not saying it will make you into an expert overnight, and I’m not saying you can’t come to the table with zero dev experience, but as a starting point, it is wonderful. To find out why, keep reading…
Continue reading TUAW Bookshelf: iPhone in Action
TUAWTUAW Bookshelf: iPhone in Action originally appeared on The Unofficial Apple Weblog (TUAW) on Wed, 04 Mar 2009 18:00:00 EST. Please see our terms for use of feeds.
Read‘|’Permalink‘|’Email this‘|’Comments“