Coding

Latest

  • TUAW Responds: Reader requests 1.1.2 Header Bundle

    by 
    Erica Sadun
    Erica Sadun
    11.16.2007

    TUAW Reader scw wrote in asking if I could put together the headers for the 1.1.2 Frameworks in a downloadable format. Scw, your wish is our...um...command Number 1 Priority request. I took out some time and zipped up a complete 1.1.2 header bundle for you. TUAW hopes this helps you update your files for 1.1.2.

  • iPhone Coding: Use NSBundle and avoid hard-coded paths

    by 
    Erica Sadun
    Erica Sadun
    11.13.2007

    Listen up, iPhone coders, NSBundle is your friend. It lets you look in your main .app bundle and retrieve files without hardcoding paths. Avoid "/Application/MyProg.app/foo.png" and replace your absolute references with relative ones. This lets your users install your applications wherever they wish. An NSBundle object locates your app in the local file system so you can access resources and use them in your programs. [NSBundle mainBundle] returns the object for your app. When you use the pathForResource: ofType: inDirectory: method, you can easily find the path to those resources. For example, to find the Default.png file in the top level of an iPhone or iPod touch application, use: [[NSBundle mainBundle] pathForResource:@"Default" ofType:@"png" inDirectory:@""]]. Couldn't be simpler. Skip the type argument (use @"") for resources without extensions.

  • iPhone Coding: iPhone Developer Docs updated to 1.1.2

    by 
    Erica Sadun
    Erica Sadun
    11.13.2007

    A few weeks ago, our Mike Rose posted about my 1.1.1 iPhone header documentation. I'm pleased to say that after a huge amount of work, I've updated those docs up to version 1.1.2. The new documents cover all the Objective-C headers for the iPhone and iPod touch 1.1.2 frameworks including updated keyboards and other system-level modifications. If you're wondering about "Oktoberfest", despite the November release date, that's the Apple internal name for the user bundle. Previous bundles included "Heavenly" (1.0.2) and "Snowbird" (1.1.1).

  • iPhone Coding: Bonjour wrapper simplifies iPhone implementation

    by 
    Erica Sadun
    Erica Sadun
    11.07.2007

    Man, I wish this Bonjour class wrapper had been around a few weeks ago. The CFBonjour Cocoa class simplifies mDNS/Bonjour programming for the iPhone and iPod touch. iPhone developer Ecume pointed me towards this simple class that allows you to publish and subscribe to Bonjour network services with a minimum of programming. He's using this code to write a DropCopy client for iPhone. Hopefully this new step forward will make it a lot easier for more developers to get on the iPhone/Bonjour wagon--the opportunities go far beyond Zune-like file sharing. (Speaking of Zune-like sharing, my new version of SendSong allows you to squirt your music to anyone using SendFile.) Thanks to Ecume.

  • Woopsi makes homebrewing easier

    by 
    Candace Savino
    Candace Savino
    11.04.2007

    We certainly love using and playing homebrews, but we've never actually tried to create them. The idea of it just always seemed so ... daunting. Homebrew developer Ant512 is trying to make the process easier, however, with an application called Woopsi.This program essentially brings a windowing system to the DS, specifically tailored to homebrew programmers. It won't suffice as a proper desktop environment for the handheld, but that's not the purpose of the application. Rather, it's meant to help users create their own applications and reduce a hefty amount of code writing.We still don't think we'll be able to create anything cool, but hopefully Woopsi will help some aspiring homebrewers with the process, leading to more great stuff in the future.[Via QJ.net]

  • iPhone Coding: Build your Leopard toolchain from scratch

    by 
    Erica Sadun
    Erica Sadun
    10.31.2007

    Why settle for out-of-date toolchains when you can build the latest and greatest from scratch. Nicholas "Drudge" Penree put together this handy how-to that walks you through the process. Be aware that you'll need to be running the gold master version of Leopard with the latest XCode release. These instructions do not work on the prerelease developer builds. For more information and for peer support, head on over to irc.osx86.hu to the #iphone-dev and #iphone-uikit channels.

  • iPhone Coding: Leopard-compatible Binary Toolchain Installer

    by 
    Erica Sadun
    Erica Sadun
    10.31.2007

    Looking to compile software for the iPhone and iPod touch under Leopard? There are two approaches: You can download the latest toolchain svn from Google Code or you can use a legacy toolchain installer that just happens to work under Leopard. Last night, Nicholas "Drudge" Penree pointed me towards a copy of Elliot Kroo's legacy 0.04 toolchain installer. This installer dates back to the "bad old days" of arm-apple-darwin-cc, before the better gcc version appeared. On the other hand, a working solution is a working solution so I'm not complaining. After downloading, I mounted the disk image, ran the installer and then the "ooh shiny" program. To make this work, I had to install a copy of the iPhone disk as /usr/local/arm-apple-darwin/heavenly. There are various methods for getting a copy of your 1.1.1 disk floating around the net up to and including decrypting the install dmg from Apple. Google for details if you're unsure how to do this. Next, since this is a VERY legacy install, I had to edit my .arm-cc-specs and fuss with them until they matched my system. Finally, I grabbed a copy of my old libarmfp.dylib file and put everywhere I could think of until I got some existing projects to compile. I believe my final places to put it were /usr/local/arm-apple-darwin/heavenly/usr/lib/ and /usr/local/local.toolchain/heavenly/usr/lib but you'll have to hunt around on your own system to see where it fits. You'll be looking to put it in the same folder that has the working gcc_s_v6.1 library. After this, I ended up with a working--albeit legacy--toolchain running under Leopard. I'll download and compile the new toolchain at some point but this gives me some much-appreciated breathing space before I need to do that.

  • Blizzard putting a new sound engine into 2.2

    by 
    Mike Schramm
    Mike Schramm
    09.18.2007

    So as you've probably noticed by now, 2.2 is not coming today. Bummer-- that means I was wrong on the podcast. First time for everything, I guess (I'm kidding!). Now I have to hope it won't come for a while, since next week I'll be way too busy playing Halo 3.But the CMs are sharing some info about why the patch is so delayed. The main culprit seems to be the voice chat system, and more than that, the fact that Blizzard completely updated their sound engine while including it. Blizzard, like many other companies, didn't write their own sound engine for WoW. They licensed one called FMOD, by a company called Firelight (the same engine used in Bioshock, Metroid Prime 3, Heavenly Sword, Crysis, and many other games). Firelight just released a new version of FMOD-- their website mentions 4.08 as the latest, though I'm not sure that's the exact version Blizzard is using in 2.2 (Blizzard may be a version behind, just to make sure there are no problems with the system before they push it out to all 9 million clients). 4.08 also just dropped a few days ago, it seems, but maybe Blizzard, as one of Firelight's biggest customers, had access to the new version before anyone else did.At any rate, that's why 2.2 is taking so much longer-- they're working on code, not class balance. Hopefully, whenever we do see this patch drop, it'll sound that much better.

  • iPhone Coding: Using the Accelerometer

    by 
    Erica Sadun
    Erica Sadun
    09.10.2007

    You don't need to use a lot of fancy routines to subscribe to data generated by the iPhone's built in accelerometer. A single UIApplication delegate lets you know whenever the iPhone has updated its tilt data. When you add a method for (void)acceleratedInX:(float)xx Y:(float)yy Z:(float)zz to any UIApplication, the iPhone sends regular messages to your application giving you values for X, Y, and Z. These values are not exactly what I first expected: X = Roll X corresponds to roll, or rotation around the axis that runs from your home button to your earpiece. Values vary from 0.5 (rolled all the way to the left) to -0.5 (rolled all the way to the right). Y = Pitch. Place your iPhone on the table and mentally draw a horizontal line about half-way down the screen. That's the axis around which the Y value rotates. Values go from 0.5 (the headphone jack straight down) to -0.5 (the headphone jack straight up). Z = Face up/face down. I expected the Z value to correspond to yaw. And it does not. It refers to whether your iPhone is face up (-0.5) or face down (0.5). When placed on it side, either the side with the volume controls and ringer switch, or the side directly opposite, the Z value equates to 0.0.

  • Push-to-Talk developer pack

    by 
    Erica Sadun
    Erica Sadun
    09.06.2007

    The barriers to iPhone-to-iPhone communication are quickly dropping away. Yesterday I put together a push-to-talk developer pack in the spirit of "just add water", or in this case, "just add point-to-point data transfer". It includes a sample app and code for recording and playing back audio as well as a record-time limiter that will override any push behavior if a message goes on for too long. What it needs is the inter-iPhone technology. I throw this kit into the wild. Let's see what comes back.

  • iPhone Coding: Using the Slider

    by 
    Erica Sadun
    Erica Sadun
    09.04.2007

    In terms of application development, the iPhone's UISlider is pretty standard. It works like nearly every other slider you've ever programmed. It offers a drag-able thumb control that moves between a minimum and maximum value. As its dragged, the slider produces events that you can redirect to your main application.

  • Found Footage: $2 multitouch screen, made with iSight

    by 
    Mike Schramm
    Mike Schramm
    08.28.2007

    Multitouch is all the rage lately, but one of the drawbacks is that it's still pretty expensive. Enter this ingenious device-- it's a bag with dye colored water in it. That bag is then laid flat on a glass table, an iSight camera is placed underneath, the computer is coded (it appears, anyway) to look for fingertips pressing through the dye, and just like that, you've got a multitouch interface.Really incredible. Of course, it's hard to figure out how this could be used for something like the iPhone-- instead of a camera, you'd have to have some kind of light sensors behind the dye, and you'd have to figure out a way to have the dye-colored water stay spread even throughout the bag. In fact, come to think of it, I'm not really sure how most multitouch interfaces work-- maybe this is closer to the real thing than I imagine. Even if not, very cool idea, and I'm almost surprised to see it really works so well.[via Waxy]Update: Looks like the video is a little old-- this was posted back in early June, even before the iPhone was released. But it is still really cool, and it's the first I've seen it.

  • iPhone MAME project launched

    by 
    Mike Schramm
    Mike Schramm
    08.20.2007

    I'm pretty sure that, with this link, we've hit all the basic retrogaming points for the iPhone (wait-- can I play Nethack on it yet?). Yes, iphone-sdl-mame aims to bring all of your MAME favorites to Apple's latest endeavor. Like all of the other projects we've covered, it's open source, unofficial (duh), and a work in progress. From the text, kaisersoze (who's heading up this go) says PacMan and Q*Bert will run, but other games are too slow to be playable at the moment. And there's no word on whether control of anything is working yet or not.So it's a super early build-- all there is at the moment is just a few files in the subversion repository, so if you're looking to just install a file and get rolling, not so fast. But as with all of these open source iPhone hacks, attention seems to equal progress, so there you go. Hopefully, now that the word's out, playing Galaga at full speed on the iPhone is just around the corner.Oh and if you don't have an iPhone yet, worry not-- MacMAME's got you covered.[ via Waxy ]

  • iPhone Coding: NSLog on the iPhone

    by 
    Erica Sadun
    Erica Sadun
    08.17.2007

    NSLog provides one of the most important debugging tools for your iPhone arsenal. Unlike its Cocoa equivalent, the iPhone NSLog sends information to the command line. It's basically a printf for NS and UI objects. To print an NSString, for example, you might use NSLog(@"String is %@", mystring);. When this line executes, the results print out almost as if you had done a printf("%s", [mystring cStringUsingEncoding:1]); with an extra bit of date and time information attached. Use %@ for objects. Otherwise use the standard C formatting codes: %d for integers, etc. You will only be able to see NSLog results when your iPhone applications are launched from the command line. Launching them from SpringBoard hides the NSLog information. The iPhone Crash Reporter provides important information about failed program execution. Go to /Library/Logs/CrashReporter to see dumps from the most recent crash. Dumps are in the form of property list files, which you can open in a text editor or in Apple's Property List Editor.

  • iPhone Coding: Working with the Navigation Bar

    by 
    Erica Sadun
    Erica Sadun
    08.16.2007

    The iPhone Navigation Bar offers a simple way to add button-based navigation to your iPhone applications. Defined in UIKit/UINavigationBar.h, this class allows you to add one or two buttons to the kind of blue iPhone-looking bar shown here. Use these buttons to move between program screens or to add direct functionality to your application.

  • iPhone Coding: Recording Audio

    by 
    Erica Sadun
    Erica Sadun
    08.06.2007

    %Gallery-5616% Yesterday, I figured out how to record audio on the iPhone. Today, by popular request, I'll go through the how-to part. And, for those of you paying close attention, I've updated the application with lots of nice new features. For those of you playing along at home, here are the basics you'll need to know to get started with audio recording.

  • Apple posts iPhone for Web Developers guide

    by 
    Darren Murph
    Darren Murph
    07.07.2007

    Well, would you look at this. Yet another way to entertain yourself with that newly purchased iPhone, if you understand web development jargon, that is. Apple has now posted a guide that gives web developers the tools to design and create their very own web-based applications. The tutorial runs through a basic understanding of the user-iPhone interactions, integration with Phone, Mail, and Maps, page optimization techniques, AV guidelines, and of course, the low-down on what Safari for iPhone supports. Now, get to work -- there's hordes of non-techies just waiting to indulge in the fruits of your labor.[Via TUAW]

  • Computer uses webcam to play Pong with itself

    by 
    Darren Murph
    Darren Murph
    06.15.2007

    As Pong attempts to solidify itself as the most hacked up game in the history of mankind, Ashish Derhgawen has programmed his computer to actually play a homegrown version of the title without any human interaction at all. By utilizing a webcam as the machine's eyes, he was able to write up an image recognition program that could detect borders and make appropriate movements based on where the ball currently was. Nothing too dramatic in terms of execution, but teaching an old computer new tricks always brings about a certain sense of pride. Check the video after the jump.[Via hack a day]

  • Garmin Developer website unloads APIs, toolkits

    by 
    Darren Murph
    Darren Murph
    05.30.2007

    If you're tired of tirelessly hacking your navigation system in order to get the features you want up and running, Garmin is making things a good bit easier, by opening up a developer website that gives users free access to a plethora of APIs, toolkits, and web services. Put simply, the idea is to give customers the ability to "make their website, applications, and data content compatible with Garmin navigation systems." Currently, the six core offerings include the Communicator Plugin, MotionBased Web Services, Content Toolkit, PeerPoint Messaging System, LBS Toolkit, and Fleet Management Interface." Of course, you can't take advantage of the niceties until you put those coding muscles to work, so be sure to hit the read link and flip a coin to see which application deserves first dibs on getting your attention.[Via GPSReview]

  • Datel Drive Doctor for Wii does statistics and code injection, requires soldering

    by 
    Conrad Quilty-Harper
    Conrad Quilty-Harper
    05.19.2007

    Surely the whole point of purchasing a commercial product to run a few homebrew games or activate a few cheat codes is that there's no soldering required: that's not the case with the Datel Drive Doctor for Wii. The $34.95 Drive Doctor is designed to allow Wii owners to connect their console to their PC with a USB 2.0 cable, enabling you to review the internal statistics of the Wii, eventually run homebrew games, and even inject code "into the data stream ... it's fun!" Unfortunately, the press release mentions that it'll require a little soldering of wires in order to get the little box that clips on the back into a working state. Most people won't find that fun, but then again most people wouldn't find the idea of accidentally injecting code that kills their Wii fun either. We're left thinking that this one's strictly for the intermediate or pro hacker, so stay away if your coding and soldering isn't up to scratch. Us mere mortals will wait for something a little more dumb-consumer friendly, thank you very much.[Via Nintendo Wii Fanboy]