Archive for August, 2008
Support Barack Obama
I’ve made a few financial contributions to the Obama campaign, which is the most important run for the presidency in my lifetime. Be a part of our own redemption as a nation — help elect this man the next President of the United States with not only your vote, but with a small contribution to the campaign.
Regex on the iPhone
John Engelhart wrote a nice piece of code, RegexKitLite, that allows regex programming on the iPhone. RegexKitLite is part of his larger RegexKit project.
There is something funky about how the simulator and device SDKs work with respect to how this code pulls in header files, however. I had to insert an #ifdef as a hack to get the code to work on a real iPhone device. The code works as-is if running in the simulator. Here is the mod, to RegexKitLite.m:
#ifdef iPhone
else { if((splitStrings = rkl_realloc(&scratchBuffer[1], splitStringsSize, (NSUInteger)1)) == NULL) { goto exitNow; } }
#else
else { if((splitStrings = rkl_realloc(&scratchBuffer[1], splitStringsSize, (NSUInteger)NSScannedOption)) == NULL) { goto exitNow; } }
#endif
near the original line 579.
October 21, 2008 update John Engelhart sent me a note indicating that v2.2 of RegexKitLite is available, and that this version probably doesn’t need this #ifdef. He was right: I tested my original simple test code against v2.2, and it seems to work fine. Thanks, John.
UI programming on the iPhone
Some good links on programming view controllers and table views on the iPhone.