Posts Tagged ‘tech’

iPhone OS 2.0.1 - Installed

Tuesday, August 5th, 2008

I just finished updating my 2G iPhone to OS 2.0.1. Usually when I sync my phone, I skip the “backing up iPhone” stage because it takes too damn long, but tonight, I figured I’d better let it complete. That stage alone took over an hour. After the upgrade, the entire sync process took under three minutes. That’s a serious improvement. As for other changes, I haven’t had time to play with it yet. I will be sure to note any improvements or annoyances I find.

iPhone OS 2.0.1 Is Out

Monday, August 4th, 2008

I just read that the new version of the iPhone OS is out. I’ll be installing it in an hour or so. I’m really looking forward to this update, since 2.0 is buggy as hell.

BTW, I posted this using the WordPress iPhone app. It’s a very cool app, but it would be so much better if the iPhone had bloody cut & paste!!!

Strange Seg Fault In Simple Cocoa App

Saturday, July 26th, 2008

I just got Aaron Hillegass’ 3rd edition of Cocoa(R) Programming for Mac(R) OS X (3rd Edition) and am working through it as if I never went through the 2nd edition. (It’s been so long since I did any Cocoa, that seemed like the smart thing to do.) Anyway, I’m in Chapter 4 on memory management and things were going fine. Until all of a sudden, the program started dying with a segmentation fault. After trying to figure out what I’d done wrong, I figured I’d mistyped something and just wasn’t seeing it, so I reverted my changes back to what I had in my Subversion repo. I then started making the changes again. And again the program died with a segfault. 

Any time I’m working through a programming book, I always type all the examples in by hand, rather than downloading pre-written code. I learn better that way. But in cases like this, I don’t have a problem with looking at the author-provided code to see where I went wrong. I downloaded the solutions from Aaron’s site and started comparing. I found the problem pretty quickly.

Originally, the code for creating the NSCalendarDate object for today’s date was

NSCalendarDate *now = [[NSCalendarDate alloc] init];

which, when you later add the code to release it, would have worked fine. But at some point between when I wrote that line of code and when I added the release, Aaron mentioned a convenience method on NSCalendarDate for getting back an autoreleased date object. That code looks like this

NSCalendarDate *now = [NSCalendarDate calendarDate];

I had changed my code to use that instead of the original version. That was in Chapter 3. So, when I hit Chapter 4 and added the call to release the date object, I ended up with my segfault. The chapter assumed that you still had the alloc & init calls, and so made no mention of the calamity that would ensue if you had switched to the other way of getting today’s date.

What made this difficult to find was when the segfault occurred. It didn’t happen when I called release on the date object. It happened on this line

[pool drain];

which is one line before the program ends. That’s boilerplate code there, so it was really strange that it was barfing. The reason this caused the problem is that this way of getting a date is autoreleased, which means that unless I retain it somewhere, it’s going to get deallocated when the NSAutoReleasePool is deallocated. But when I called release on it, I ended up setting it’s retain count to 0, so when the pool was drained, it ended up sending a release message to an object that had already been deallocated, which is a no-no.

Bottom line is that had this been a big program, this could have been really hard to track down. Of course, turning on the Objective-C 2.0 garbage collector would have solved the problem too, but then you have a Leopard-only program.

A Few Things I Hate About iPhone OS 2.0

Saturday, July 26th, 2008

I love the new iPhone 2.0 OS, mostly, though I really think they should have let it bake for another couple of months before releasing it. There are parts of it that just don’t feel fully cooked. For instance, one application dying should not cause the entire phone to reboot. That doesn’t happen in OSX, nor does it happen in Linux. It does happen in Windows, but that’s another story. It’s happened to me at least six times with different apps, and that’s just not cool.

Next, it’s really difficult to actually delete an application from the phone. I’ve figured it out, but here’s what I went through. The first time, I deleted it from the Applications panel of iTunes and said “yes” when it said that they would be removed from the phone the next time I did a sync. Perfect. Except it wasn’t. The next time I did a sync, I got a dialog saying that there was purchased content detected on the phone and did I want to transfer it. A parenthetical note advised that failure to do so would result in the content being removed from the phone. I answered “transfer” because I wasn’t sure if I’d installed anything directly to the phone or not. Of course, the only content that was on the phone that wasn’t in iTunes was the apps I’d just deleted. Actually, the very first time I tried to delete apps this way, I didn’t get the “purchased content on phone” message, because I’d seen it once before and had checked “always transfer” as the default. That means that it would be impossible to ever remove apps this way, since iTunes would always transfer them from the phone back into iTunes.

So then I tried deleting the apps from the phone itself. I pressed the icon and held it down until the screen went “wiggly” and then pressed the ‘X’ on the icons I wanted to delete. They got removed just fine. Until I did a sync with iTunes again, at which time they were dutifully reinstalled.

What this means is that there is only one surefire way to delete apps: delete them from both the iPhone and iTunes before doing a sync. You could just delete them from iTunes and then answer “don’t transfer” from that dialog the next time you sync, but you have to make certain that the only “new” content on the phone is the deleted apps, and not something that you want to hold on to. Good luck with that.

Finally, I hate the fact that every time I do a sync, iTunes will gladly spend 20 minutes backing up the iPhone. It apparently goes brute force and just backs up everything on the phone, whether it needs to or not. Some of the installed apps, like Apple’s Texas Hold’Em, have tons of images and audio files, which take forever to backup. And once those files have been backed up, there’s no reason to ever back them up again; they won’t ever change! A little checksumming of files could go a long way towards solving this.

I still love my iPhone and the ability to install apps on it is awesome. I’ve paid my $99 to Apple to get into the developer program, and as soon as I come up with something decent that needs writing, I’m going to write it. So even though this post contained the word “hate,” I still love you, iPhone. XX OO XX

A day or so ago Apple began seeding iPhone OS 2.0.1 to developers, so I’m hoping that goes GA quickly and that it addresses some of these problems. Just like Leopard had problems at launch and a relatively quick point release solved them, that’s what I’m hoping for with the iPhone.

07-26-2008 16:20 Update: When I sat down to write this post, it was originally “Three Things I hate…” but at the end, I’d really only included two. So I changed the name. But a little while ago, I remembered the third thing, and that’s when you update apps with new versions, they don’t stay where I had them. For example, just this morning, UrbanSpoon had an update and when it was updated, it moved from page 2 to page 5. That’s very uncool, too.

I Paid My $99 To Apple

Saturday, July 12th, 2008

As I said yesterday, I finally got my acceptance letter from Apple that essentially allows me to pay them $99 in order to develop iPhone software. I have just now paid the $99, so now it’s just a matter of waiting for the license or whatever it is that they will send out. Let’s hope it doesn’t take as long as it did for the acceptance letter.

As I write this, I am downloading the iPhone SDK. I played around with the first beta Apple released, but I haven’t really done anything with it since then. That was before they got Interface Builder going, so it should be a lot better now than it was then. I’m looking forward to getting started; now I just need to think of something that needs writing.

07/13/2008 00:37 Update: About 20 minutes after posting this, my Activation Code email arrived from Apple. Fun times ahead.

So *Now* Apple Will Let Me In…

Friday, July 11th, 2008

After months of waiting, I received this email from Apple just a few minutes ago:

Thank you for applying to the iPhone Developer Program.

We have reviewed the information you submitted when you initiated your program enrollment request and we are ready to instruct you on the steps required to complete the enrollment process.

Please click here to review and agree to the Standard License Agreement. You must execute this agreement prior to completing the purchase and activation process for the iPhone Developer Program.

Once you complete and activate your purchase, your enrollment will be complete.

Thank you,

iPhone Developer Program

I guess now that the App Store is live, they can let more people into the program. Now I guess I’ll have to re-download the SDK and pony up.

WordPress To Release An iPhone Blogging Client

Friday, July 11th, 2008

Oh man, this is just too cool. I switched to WordPress just a few days ago and today I see that they have an iPhone blogging client that should be released “soon.” Just one more thing telling me that I made the right decision picking WordPress.

My iPhone Apps

Friday, July 11th, 2008

After spending way too much time last night going through the App Store, I finally went to bed. But not before I took some screenshots of everything installed on my iPhone. (That’s another cool feature of iPhone 2.0: screenshots. To take one, hold down the round button on the front, and then press the power button. The screen will flash white, and then the image shows up in your photos. Very nice.)

I will most likely uninstall at least a few of the apps, as they either aren’t that great, or they require registration at some website that I’m not sure about. Anyway, have a look.

iPhone Launcher Page 1iPhone Launcher Page 2
iPhone Launcher Page 3iPhone Launcher Page 4

 

You can click on each one to see a larger version. I still can’t install apps from within iTunes, though. All of those apps I installed from the iPhone itself. The standout apps, so far, include
  • Mobile Flickr
  • Box Office
  • Twitterific (though I wish it had separate tabs for replies and direct messages)
  • Facebook
  • Band
  • PhoneSaber (Thomas especially likes this one)

iPhone Password Entry Is Now 600% Better

Thursday, July 10th, 2008

One of the most frustrating things about the previous version of the iPhone software was password entry. Apple used a masked entry field, which means that instead of seeing what you type, you see a splat. On a computer with a big monitor, that’s understandable; you don’t want someone stealing your password by looking over your shoulder. But on the iPhone, it seemed a bit silly, and it was incredibly hard to know if you’d typed your password properly.

But with iPhone 2.0, things have changed. It still uses a masked entry field, but now the most-recently typed letter is visible until you type the next character, or for about 2 seconds if that’s the last letter. Oh, mama, that’s an awesome improvement. I will make far fewer errors now! :-)

Why Can’t I Install iPhone Apps Via iTunes?

Thursday, July 10th, 2008

OK, so I’ve got iPhone 2.0 loaded, and I successfully installed an app from the App Store from the device itself, but I can’t seem to get app installing working from within iTunes. I have downloaded three apps via iTunes and they all came down successfully, but they don’t show up on my iPhone. All three show up in the Applications pane of iTunes, so they successfully downloaded to my Mac, but even after manually syncing and unplugging and re-plugging the iPhone in, they never show up on the device. Going into the App Store on the iPhone itself and installing from there works, but I do get a message saying that I’ve already purchased that app, and would I like to re-download it for free. After that, the app is installed, but something is wrong. Or maybe I missed something.

08/01/2008 17:38 Update: I discovered the trick a day or so after I wrote this, but since someone else is still having the problem, I’m updating the post with the answer. Follow these steps

  1. Click on your iPhone in the Devices section of iTunes
  2. Click on the Applications tab
  3. Check the “Sync applications” checkbox
  4. Select either “All applications” or “Selected applications” and then check the ones you want synced.
  5. Click the “Sync” button.

That’s it.

iPhone 2.0, Installed. First App, Installed.

Thursday, July 10th, 2008

My download of the iPhone 2.0 kit finished successfully. I then installed it a restored my settings and such. Now, about 25 minutes later, I’ve installed my first app. I’m going to be digging through the App Store for a while tonight, looking for cool things to install.

 

iPhone 2.0 Is Downloading

Thursday, July 10th, 2008

I can’t wait until tomorrow to get the new iPhone 2.0 software. I’m downloading it now at a rate of 715.47K/s and once it’s downloaded, I’m gonna slap it on my phone. I’m using the instructions found here for the procedure.

Ooh! Only 2:24 until it’s finished downloading.

 

MiddleClickClose for Safari 3.1.1

Friday, April 25th, 2008

Someone wrote to tell me that MiddleClickClose was no longer working after upgrading to Safari 3.1.1. I hadn’t yet installed the latest version, so this was news to me. I just upgraded, but MCC still worked for me. I’m not sure what the user’s problem was. Maybe he upgraded from Safari 3.0 to 3.1.1, skipping 3.1, which I can see how that would have broken it for him.

I did change the MaxBundleVersion in Info.plist to 5525.18, which is the current version of Safari, so if you’re having problems, install the copy linked below. Or edit the Info.plist file in MiddleClickClose.bundle/Contents yourself.

iTunes Should Remember Window Size

Friday, April 18th, 2008

I subscribe to a lot of podcasts, and lately I’ve been subscribing to lots of video podcasts. I love watching GeekBrief in ginormous HD format. But not all of the videocasts come in that large format, so I have to right-click on them and select ‘Double Size.’ But the next time I watch GeekBrief, it spans both monitors, because iTunes applied my ‘Double Size’ selection to this video as well.

What would be nice is if iTunes remembered your video settings for each subscription instead of one setting for all. This would allow me to set ‘Actual Size’ for GeekBrief, but ‘Double Size’ for The Buzz Report. That would be really nice.

MiddleClickClose Updated

Tuesday, April 8th, 2008

I announced here that I had updated MiddleClickClose to work with Safari 3.1, but that it had problems loading under Safari 3.0. Actually, the problem was that it wouldn’t load on a PPC chip; I was testing on my iBook G4, but I hadn’t generated a universal binary. That was caused by having the iPhone SDK installed. Anyway, I dropped back to Xcode 3.0 and got a universal binary built, and now everything is happy.

If you want the plugin, ensure you have SIMBL installed, download the binary package below, and unzip it in ~/Library/Application Support/SIMBL/Plugins and restart Safari.

As usual, it’s distributed under the GPL.

MiddleClickClose For Safari 3.1

Friday, March 21st, 2008

As I reported two days ago, after I installed Safari 3.1, my MiddleClickClose extension stopped working. Well, I’ve gotten it working again. , but it doesn’t load under Safari < 3.0. So, only install this version if you are using Safari 3.1. If you are using an older Safari, use this one.

As before, I’m releasing this under the GPL.

My, What a Large Amount of Virtual Memory You Are Using

Thursday, March 20th, 2008

I just checked my Activity Monitor to see how much of my 6 gigabytes of RAM was in use. I was shocked (shocked!) to discover that a Java RMI server program (that I wrote) appeared to be using a bit more virtual memory than it should. Take a look at this screenshot of this process:


I’m sure it’s just a reporting error, but it was still funny to see.

Safari 3.1 Breaks My Middle Click Close Extension

Wednesday, March 19th, 2008

If you install the new Safari 3.1, my MiddleClickClose extension stops working. The first time you launch Safari, SIMBL complains that the plugin hasn’t been tested with this version of Safari, but that’s easily fixed by putting the proper version 5525.13 in Info.plist for the tag MaxBundleVersion. Once that’s done, the extension loads, but doesn’t seem to do anything. The problem is that the system is no longer delivering a mouseUp event when you middle-click a tab. I’m not sure what’s going on, but I will look into it. I’ve become dependent on my middle-clicks…

Apple Tells Me “Thanks, But No Thanks”

Friday, March 14th, 2008

Like 10 million other iPhone fanboys, I applied for the Apple iPhone developer program. Today, one week after applying, I received this email

Thank you for expressing interest in the iPhone Developer Program. We have received your enrollment request. As this time, the iPhone Developer Program is available to a limited number of developers and we plan to expand during the beta period. We will contact you again regarding your enrollment status at the appropriate time.

Thank you for applying.

Best regards,

iPhone Developer Program

And I’ve seen lots of other people on Twitter complaining of getting the same email. One disappointed reject said this

As I understand it, no one got in except for a handful of large partner companies alla Google.

It’s bad enough that the “free SDK” isn’t actually free since you have to pay $99 to be able to load your apps on your own iPhone, but now they’re rejecting hopeful developers in bulk. They ought to let everyone in who wants in. What’s the harm?

Gee… I wonder if I’m violating some NDA by blogging this? I’m sure some of the helpful souls on the xcode-users list will let me know if I am.

iPhone SDK: No Joy For Me (So Far)

Friday, March 7th, 2008

Like 10 bajillion other Mac fans yesterday, I downloaded the iPhone SDK. It took me four tries to get it, but I finally got it. I installed all 5.3 GB of it, and rebooted (reboot? what is this, Windows?) and then created a sample project, just like the ADC video shows. I excitedly clicked the ‘Build and Go’ button and… nothing. Well, not completely nothing, but not what was supposed to happen.

What was supposed to happen was that the app would build, the iPhone simulator would start up, the app would be loaded onto the simulator and then it would run. My app built, but the simulator didn’t run. All I saw was ‘Debugging of “Sample” ended normally’ in the Xcode status bar. I checked the Xcode console, and I get this every time I try to run the app:

[Session started at 2008-03-07 16:42:09 -0500.]
2008-03-07 16:42:10.772 Sample[1326:10b] Warning: CFFIXED_USER_HOME is not set!
2008-03-07 16:42:10.793 Sample[1326:10b] Warning: ASPEN_SIMULATOR_ROOT is not set!
Terminating since there is no system event server.
(Run the EventPump or pass the argument “-RegisterForSystemEvents” if you want to run without SpringBoard.

The Debugger has exited with status 0.

I’ve been exchanging emails with people inside Apple about this and the only suggestion so far was to run the uninstall script in /Developer/Library and reinstall. I have done both, but it still doesn’t work. Upon the suggestion of a friend, I created a new user account, logged in as that user and tried from there. Everything worked. Which means Xcode, the SDK and the simulator are all installed properly, but something in my account is dorking things up. I am loath to ditch my account and start over from scratch, but obviously something is wrong. Does anyone have any suggestions? I am awaiting another email from my guy at Apple, but if anyone else knows anything, please let me know. And when/if I get it working, I will document what worked here.

03/08/2008 21:47 Update: It’s working! w00t! It appears that if you are running Xcode in 64-bit mode, you get the errors that I got. If you run Xcode in 32-bit mode, it works. Now, I had switched to 64-bit mode when I installed Xcode 3.0, but when I installed 3.1, it got reset to 32-bit mode. Only it didn’t get reset, at least not for my user account. That’s why when I created another user account, it worked for him. I right-clicked on Xcode in my dock and selected ‘Show in Finder.’ Then I right-clicked on the Xcode icon and selected ‘Get Info.’ On the Get Info screen is a checkbox labeled ‘Open in 32 Bit Mode’ and it was checked. I unchecked it, launched Xcode and the same problem happened. Then I re-checked it, re-launched Xcode, and now the simulator works. If I uncheck it, the problem returns, proving the cause. Thus, you must run Xcode in 32-bit mode and even if you think you’re running in 32-bit mode, it wouldn’t hurt to toggle that checkbox a time or two just to make sure. (Thanks to Daniel Cliche who suggested the 64-bit problem.)