Archive for February, 2010
February 28, 2010 5:07 pm
I just had a look, and my blog is the number one hit on google for the search phrase “iphone nibless.” That leads to a blog post I wrote on the subject last year. I linked to another blog that explained how to accomplish such a goal, but that blog post has since been taken down. Hrmph. Okay, I guess I have to cover this subject again.
Generally speaking, Apple makes beautiful apps that are elegant and easy to use. Interface Builder is a glaring exception. I can’t stand that thing. So unbelievably complicated. I can’t ever find what I’m looking for.
If you’re writing Mac apps, I guess you’re stuck with it. Most Mac windows contain a lot of controls, and you need a way to design them. If you’re writing iPhone apps, it’s a net loss. Most iPhone views contain a single control that takes up the entire view area, so Interface Builder is an unnecessary complication. So I’m going to tell you how to make an iPhone app that does not require any nibs at all. I am using Xcode 3.2.1 on Snow Leopard, but these instructions will likely work for older versions as well.
1) Start Xcode. From the File menu, pick “New Project.” In the window that opens, select the iPhone OS Application category on the left. In the group on the right, pick “Window-based Application.” This may work fine for the other project templates, but I haven’t tested that. Create the new project, name it whatever you want.
2) Remove MainWindow.xib from the project and put it into the trash. It is no longer needed. (Yay!)
3) Edit the Info.plist for your project by double-clicking on it. It will have a name similar to projectname-Info.plist. The plist file will have a key named “Main nib file base name,” with the value MainWindow. Remove this key completely: select it, and press the Delete key. Save the file.
4) Xcode will have created an app delegate class for your project, named something like niblessAppDelegate. Yuck, what a horrible name. Rename this class to AppController, by directly editing the header and source files for the class. You can of course pick a different name, or even skip this step altogether, but I’m going to assume from here on out that your app delegate class is called AppController.
5) At this point, you have destroyed the mechanism that iPhone OS normally uses to recognize the name of your app delegate class, which it needs to know to load your app. Fortunately, there is an easy way around this: you must pass your app delegate’s class name to UIApplicationMain(). Xcode created a file called main.m that contains your app’s main() function. Edit it now, and change main() so that it looks like this:
argc, char *
pool = [[NSAutoreleasePool
argc, argv, nil
pool = nil
That’s it, you’re done. You may continue modifying this project until you have a real application.
At this point, you might be thinking: Whoa, scary change. Is this really safe? Well, I can offer myself up as an example. I’ve submitted two of my own apps to the App Store that use this technique, both of which have been downloaded thousands of times. I’ve gotten hundreds of emails from users over various issues, but my apps not having nibs has never been a problem.
February 27, 2010 11:22 pm
Dear internet: I have been searching for a UIProgressHUD replacement for many, many months. Why have you failed me? I don’t suppose it was because of that other, similarly named UIProgressHUD replacement? Which I am not going to link to or name, because it sucks. Sorry, yes I am a jerk, but it does. If I have to explain to you why it’s a bad idea to make a progress view that’s launching background tasks, then there is no helping you.
So, anyway. In case you’re new to this. UIKit has a nice control called UIProgressHUD for displaying a heads-up, semi-transparent view with a spinny-control on it, and a single line of text. It looks good, it works well, it’s easy. The only down side is that it’s undocumented, so you can’t use it in apps destined for the App Store.
I used UIProgressHUD in a project I was writing for a client a few months ago. This particular app was not destined for the App Store, so it seemed like a nice shortcut. Maybe that’s not such a hot idea, but they weren’t paying much, so I couldn’t justify a detour for writing a brand-new view. But now here I am again, needing the exact same thing for my card game, and google searches still only turn up that progress view that thinks it’s an app launcher. Hrmph. Time to write my own, I guess.
My goal was to write an exact, drop-in replacement for that view I can’t use. I’ve included screenshots of Apple’s original view, and my clone view. Pretty darn close, don’t you think? The only real differences are details that I don’t want to change. For example, I think they picked a font size that’s a bit excessive.
It would be great if I could just paste the source file and header file right into this post, for your amusement. My view is mercifully short, and would lend itself to that. Alas, it requires several support modules, so I had to make it into an example Xcode project. I’ve developed a huge library of iPhone support code by this point, so it doesn’t make sense to duplicate things in every single view and controller I write.
One clever feature of my demo project: you can change one line of code and it will use either UIProgressHUD or my own WBProgressHUD. No other code has to change, because the two views are that similar, dawg. It makes for a good test bed for developing a clone view such as this one.
Download wbprogresshud.zip by clicking here. If you like this project, how about hiring me to write more stuff like it? My contact details are on my About page.
February 26, 2010 4:34 pm
I’ve heard from several players that it’s possible for Hearts Net to get into a situation where it appears “stuck,” because one robot won’t play a card when it should. This seems most likely to happen to people who play the game in short bursts, interrupted frequently with phone calls or texts or whatever. The bug also exists in Hearts Solo, but is unlikely to be experienced there, since it doesn’t let you play a game for very long. I’ve never experienced this bug personally, because I almost always play whole games at a time.
The short-term fix is easy. The game isn’t really locked up. Go to Settings, and press “New Single-Player Game.” This starts a new game, which won’t be stuck.
The long-term fix, of course, is that I have to find and fix the bug. I have an idea what it might be, but I’m not 100-percent sure. I’ve applied my hoped-for fix to the code, and I’ll submit it to the App Store pretty soon.
The reason that I haven’t already submitted this is that I’m also working on another feature, which I guess I’m calling “state upload.” The card game engine is capable of saving all its state to a block of memory about 3.5k in size. This is the mechanism used when the game saves its state between runs, so it can start up right where it left off. An interesting side effect is that, if I have the saved state file from your game, I can recreate whatever situation you might be experiencing in my local development environment.
Everyone is telling me that the “shy robot” problem persists between runs of the program. That means that the screwed-up situation is definitely stored in the game’s state data. By examining state data from somebody whose game is in “shy robot” mode, I should be able to exactly duplicate the problem locally. Any programmer can tell you that a bug with a reproducible test case is a bug that’s easily fixed. So if my first try for fixing this bug doesn’t work, it’s almost a certainty that I can fix it by examining the state data from somebody who’s experiencing the problem.
There’s another reason why I think this is a feature worth spending development time on. I now have several players who are very opinionated about perceived shortcomings in my Hearts-playing robots. They email me with very detailed situations where they had this set of cards, and a certain robot had that set of cards, and then the robot played this particular card, and oh boy that is dumb.
If I start with nothing but an explanation like that, it could take me days to determine the particular behavior that player is talking about. I’d only have about 60 percent confidence that I could ever figure it out. But if that player can send me his game state, I can reproduce the exact scenario he is talking about with basically no effort whatsoever.
I am fairly baffled that a silly card game is now my Flagship Product. But if lots of people are going to take it seriously, I guess I will too.
February 21, 2010 6:05 am
I lost my momentum. My rank for Hearts Net is now down to number 46 in the U.S. store. Sales are still substantial, though, so that just means that I can’t live solely on the profits, as I might have been able to do if I’d made it into the top ranks. Still plenty good enough for me to want to continue improving it. Right now I’m working on porting the game to Mac and iPad.
Here’s an excerpt from an email I got from a satisfied player, named John Maldaner:
Last night I played Hearts Net via wifi with my wife. Game setup was exactly as described in the instructions. No problem. There is a slight delay when you pass and accept passed cards. There is a slight delay to go to the Next Hand. Both of these delays make sense since one or more opponents are real people now. But, the delays can confuse you at first just because you’ve played the single-player version so much. Game play is perfect. We had no issues with the flow of the game. Nothing unusual happened. Except that I lost the game! LOL!
Regarding the robots and shooting the moon. The robots are better at stopping moon shots. They intercede early. I will give this some study and report back. I had gotten pretty good at shooting the moon in Hearts Solo. The real key, there, was playing low cards early in a manner that seemed innocent. I could pretty easily lull the robots into playing early high hearts. That is the key. They would usually play their high hearts first, sometimes even in an obvious situation where playing a lower heart would have set me. I have not experimented enough in Hearts Net to give you a fair comparison. I will do so.
I would be interested in the demographics of folks that have purchased your game. I am 56 and played hearts (and spades) extensively, especially in college. I do like card games in general, but there is something comfortable about playing the games you grew up with. For that reason, Hearts and Spades are the only card apps I have purchased and play. I play both daily, at least a couple games each.
I have not experimented with other Hearts games available. I have looked at some, but it’s never gone past looking. Why? Well, most look gimmicky. Some designers have chosen to concentrate on elaborate board designs or adding in extraneous character enhancements that, to me, just take away from the game itself. Your game is true to the game. I especially like the two-touch approach to choosing a card to play. I know I can change that to one-touch. But, I don’t because at times I want to change my mind. Also, the two-touch method helps me make sure I touched the right card. This sounds simple, but other card games have not embraced that. I like your method the best.
February 19, 2010 8:01 pm
Everyone’s second biggest complaint is that they don’t like one or the other of the new color schemes. Okay then, version 2.1.0 of Hearts Net is now available on the App Store. It allows you to switch back to the original Hearts Solo “classic” theme, if you wish. The game will look almost exactly like it did when you first started playing. Get the new version of the game by clicking here.
AND: the game is currently on sale! Used to be $2.99, marked down to $1.99, because I need to move some units.
To encourage you guys to help me push the game into the top 25, I’m giving you another couple of promo codes. Instructions for redeeming promo codes can be found here.
So, a funny thing happened. I thought that the people buying my game were all Hearts Solo players, forced into upgrading because I crippled that version. But the number of people downloading Hearts Solo has peaked, and is heading down. Yet the number of people buying Hearts Net is still going up.
I wondered: You don’t suppose I made it on to one of those top lists, do you? So I looked, and I am in fact number 33 on the top paid card games list in the U.S. store. Further inspection reveals that I am in the top 100 card games list for every single country. My highest rank is 17, in Lebanon.
This is great news. Please help me drive the app even farther up the highest paid apps list!
February 18, 2010 6:55 am
Just got the sales numbers for yesterday. It’s going to sound like bragging if I keep quoting them. So I’ll just say that they are still going up.
Dear internet: I have a shameful confession. When I crippled Hearts Solo, I honestly didn’t know that it was going to create such a firestorm. But once I saw that there was indeed a great groundswell of anger bubbling up, I decided to see if I could turn it to my advantage.
There are a number of prominent, successful people in the tech community who are essentially professional trolls. I could name names, but that’s exactly what they want, and I don’t feel like further glorifying them. I’ve always despised that kind of thing. It seems like a cheap shortcut to success. Why not just do good work, and be recognized for that?
It doesn’t always work that way. There is this thing that us techie-types are mostly unfamiliar with, called “marketing.” Apparently it has something to do with connecting customers to stuff they might want to buy? I guess? I think there may be pie charts involved.
I’d always written off “marketing” as unnecessary fluff. Then I started trying to sell my own products directly to customers. Strangely enough, buyers did not just magically appear, ready to stuff money into my pockets. Puzzling.
Nowhere is this more true than for Apple’s App Store. Apple controls way too much of the experience. If you sell products on the App Store, they control your store front, your customers, your reputation, your prominence, your payment processing, and your customers’ ability to find your products. People write ridiculous, unfounded reviews of my game every day, and I have no way of knowing who they even are, much less a way to respond or correct those impressions.
I have more than a passing familiarity with trolls. I was there up close and personal as USENET was entering its death throes. I’m a bit ashamed to admit it, but I have a fairly strong trollish streak myself. I try to suppress it for the most part, but sometimes, it’s useful to be familiar with that personality type.
I’ve gotten, oh, let’s say 200 emails regarding my Hearts games in the last few days. More than I’ve gotten in the entire life of the app, before this. And a lot of them, I realized, came from trolls. They don’t care whether I crippled Hearts Solo or not. They just smell blood in the water, and they want in on the feeding frenzy.
So, here’s the confession. I fed them a little. Just a little bit. So that they would make a slightly bigger firestorm, and that the resulting blaze might attract a bit more attention than I was getting before.
Was this a good move or a bad one? It’s too early to tell. Early indicators, like my sales numbers, say “good move.” Boy, talk about conflicted. Am I joining the ranks of the professional trolls? Will I be able to live with myself? If it makes me enough money to keep me from having to get a day job, then yeah, it’s worth the ickiness.
If you find yourself sickened by the fact that I’m “turning to the dark side,” well, there’s an easy way to put a stop to it: give me something better to do. Give me enough contract work so that I don’t have to go back to a boring, paranoid, stultifying office environment ever again, and I’ll do whatever you want. I’ll keep my mouth shut and code, which is my place in the natural order of things anyway. But until that money-laden benefactor arrives, I’ll be twiddling the knobs here by myself, trying to find a way to get along in the world.
I don’t regret crippling Hearts Solo at all, by the way. That was the push that my true customers needed to see that I am serious about this. But if I’d known everything that I know now back at the beginning, I would never have released a full-featured, free card game to begin with. Then I wouldn’t be in the position of competing with myself right now. Live and learn.
February 17, 2010 5:48 am
I was holding my breath, wondering what the first full day of sales would be like. iTunes Connect had the daily report available exceptionally early today, so I didn’t have to wait long. The final total: $113.39.
Okay, wait. Just stop a minute. Um. Holy crap! Over a hundred dollars! In one 24-hour period!
Putting this into perspective. I’m sure this is a spike, induced because I’m forcing all the dedicated Hearts Solo players into the Hearts Net camp. It won’t stay that high forever. And my standard of living is such that I can’t survive on a hundred bucks a day. But if I had several projects like this, I could cut back on the contracting work that I do. Maybe even quit altogether eventually.
I’d planned to write more about the spat I seem to be having with some of the grumpy Hearts Solo players, but … no. I stopped reading the reviews, but my friend Steph didn’t. “Class action suit?” Really? Yeah, I’m sure you’ll get back every penny you all spent on my program. Seriously, this is beyond parody at this point. There is nothing I could say to that level of vitriol.
There’s a lot I can say to a hundred bucks a day, though. And here it is: lots and lots and lots of updates. I’m almost finished with the theme-changing feature. I’m just waiting for my best beta tester to have time to check it out. Then it’s headed to the App Store.
February 16, 2010 3:22 pm
Man! I’m not even reading the Hearts Solo reviews anymore. I did scan down the list of titles briefly, though. I used one of them as the title of this blog post: “Crook.”
You know what happened to this particular “crook” today? He made $54.12 on sales of Hearts Net. That’s for approximately the first 12 hours that the new Hearts Solo has been in the App Store.
That is not just “a good day” for me. That is five times greater than any other sales day I’ve had so far. This is, in fact, the first occasion where I have a glimmer of hope that the time I’ve spent on this game will be worth it. If you people keep buying $54.12 worth of Hearts Net every day, I will keep working on it until it is PERFECT. Internet multi-player, chat rooms, statistics, rules variations, Mac version, Windows version, Android version, and the most fiendish, clever robot players in the world. I’ll make you the best damned Hearts game you ever played. All for $54.12 per day.
By far, the biggest legitimate complaint I’ve gotten is that some people don’t like the color schemes, either for Hearts Net or Hearts Solo. Okay, I got the message! I’m going to release a new version of Hearts Net pretty soon, which will allow you to pick any one of the three themes that the game has had in its life. If you were fond of the plain old green-and-red theme, you will be able to get it back. If you’re willing to pay for Hearts Net, of course.
Now, a casual rundown of the various hate mail. A lot of people say I “tricked” them into downgrading to a crippled version of the program. I said exactly what was going to happen in the “what’s new” notes, and on my website. Where else would you have expected me to put this information?
Have you stopped to think what you’re complaining about here? You got Hearts Solo for free. FREE. For like eight months. And you were apparently so attached to it that you are now frothing at the mouth over its loss.
One of the people who angrily emailed me today said that he has played over 750 games. Apparently, this was supposed to make me feel bad? Because I’m taking this precious resource away from him? So he sent me this angry email, rather than just spending three bucks to get Hearts Net.
Folks, I tried to do this the “polite” way. Hearts Net has been out for over two weeks now. I have many indications that the heavy players are aware of it. It was completely, utterly ignored. Okay then, now we’re doing it my way. And on the first day, I made $54.12. Are you really going to claim I did the wrong thing here?
So, you guys just go right on shouting, as loud and long as you want. The feedback pages for App Store free apps are always a study in casual, drive-by negativity. I know a lot of you enjoy being pissed off over things like this. Okay then, you got your wish! But you are not my customers. My customers are the people who spent $54.12 on Hearts Net, on the first day that I crippled Hearts Solo. It is those people who I’m interested in. To the rest of you: Bon Voyage!
According to my access logs, the RSS feed for this blog is the most popular thing on my website, by a large margin. I know next to nothing about RSS, so I can’t gauge how many readers I have. Could be two, could be a hundred.
Most of the articles I write here are about technical subjects. I assume most of you found one of them via web search, liked what you saw, and added my blog to your RSS reader. That’s great! I love having readers.
But now, based on the nerd rage I see in my inbox, I suspect I’m going to be writing a lot of articles that are aimed at users of my card games, rather than technical articles. I think these people would be more sympathetic to my plight if they understood it, so I’m going to be writing about that. This is liable to put you off, if you came here for my technical articles, causing you to unsubscribe from my RSS feed.
Instead of doing that, I encourage you to subscribe to a subfeed, in which I’ll post “the good stuff.” Pretty much all of my technical articles include the tag ‘programming’, so I’m going to use that one to for those articles from now on. Here’s the new URL to add to your RSS reader: