UITableView separator not hiding for you? Here's why.

So I was having "fun" with UITableView trying to skin a TableView for smackBOT's multiplayer lobby. We're using a grahical separator and so I happily set the separatorStyle to UITableViewCellSeparatorStyleNone. Compile, build and run.....  and yes, the separator is still there. What's going on?

I google a little and checked the SDK docs in Xcode, every thing looks right. Customizing UITableView has been done before, it's nothing new. So what could be wrong?

Using my very analytical thinking (sorry if it sounds like I'm boosting), I looked through the UITableView properties and trying to make an "analytical" guess on what could have cause the separator being drawn even though the separatorStyle was set. Immediately, the UITableView style caught my attention. There's basically 2 different style you can have UITableView play, plain or group. I was using group and techncally it shouldn't have matter. However, in the world of software development, we can it a bug. So I set the UITableView style to plain and voila, it now works.

UITableView *tview = [[UITableView alloc] initWithFrame:CGRectMake(8, 125, 466, 180) style:UITableViewStylePlain];

So if you're having problems with "removing" the UIViewTableCell borders? That might be your problem. If you're UI design requires UITableViewStyleGroup, then I guess you're out of luck with hiding the separators without doing it in a hackish way.


Loading mentions Retweet
Filed under  //  game design   iphone sdk   leftright studios   smackbots  
Comments (0)
Posted 3 months ago

Robot App: Our IPhone Game Development story

It's been a really crazy 4 weeks of coding and hacking Robot App (we've got a name for it but we're just holding it back till the app is accepted by Apple). Robot App is our first and a robot fighting arcade style IPhone game. You basically start off as a tincap robot, whatever that means I just coined that up, and beat the hell out of other robots in an arcade style setting. So think Street Fighters but with retro style robots. Derek is the mastermind behind all the artwork, graphics and the main concept of Robot App. He is one talented illustrator.

I got to know Derek through ProgrammerMeetDesigner.com through a posting that he wrote looking for a programmer to collaborate on IPhone apps. I left a comment on his post and the rest is all history. We started brainstorming and by early April, we settled on the concept of Robot App.

Along the way, we stumbled into many potholes such as things like blurry pngs that appear fine on our Macs but came up blurry on the iPhone (both simulator and hardware). That set us back a couple of days trying to figure out what's wrong. Then we stumbled on AdHoc distribution like many developers did.

I took extra time to read up on all the documents for Adhoc distribution just to make sure that I do not get into an endless loop like many other developers were experiencing with trying to send out test builds using AdHoc Distribution. That didn't help. We still ended up burning a few days trying to get the adhoc builds "work" on Derek's phone. The build was installed on his IPhone but it just crashes on start. We went through iterations of debugging and transferring of debug logs.

Thu Apr 30 00:58:43 unknown com.apple.launchd[1] <Error>: posix_spawnp("/var/mobile/Applications/A30C2E38-7AEC-4F7B-A4BD-D911E6009EDD/robot.app/robot", ...): Permission denied
Thu Apr 30 00:58:43 unknown kernel[0] <Debug>: launchd[61] syscall_builtin_profile: /private/var/mobile/Applications/A30C2E38-7AEC-4F7B-A4BD-D911E6009EDD.sb (seatbelt)
Thu Apr 30 00:58:43 unknown kernel[0] <Debug>: launchd[61] Builtin profile: container (seatbelt)
Thu Apr 30 00:58:43 unknown SpringBoard[22] <Warning>: Unable to obtain task name port for net.leftrightstudios.robot. Either it failed to exec or it terminated immediately: (os/kern) failure


Our IPhone AdHoc Distribution
He was able to install the app, it's just when starting the app, it terminates and goes back to Springboard. In the end, we figured out that his phone had some funky configuration and installed the application with some weird permission settings. We tried many different ideas, like resetting the phone, restoring to a clean state and restoring in iTunes. All those did not work. It was only till Derek suggested booting over to windows and tried using iTunes in Windows did an AdHoc install and miraculously that works. We're still not really sure why iTunes in Windows had installed the app properly.

There's so many things that we've learned throughout these couple of months and I would end to share more in the upcoming days. But I'll end this post with some project stats and will definitely post more on our adventure on developing our first IPhone game.

Robot App Project Stats

Project Folder created: April 9th 2009
Lines of code: 5032 lines
Number of files: 30
Application size (compressed): 6.3MB
Revision control for our project resources: dropbox (http://www.getdropbox.com)

Loading mentions Retweet
Filed under  //  hacking   iphone   iphone sdk   leftrightstudio   robot app  
Comments (3)
Posted 6 months ago

Having fun with NSTimer?

NSTimer is the new thing that I'm trying to conquer

Below is the standard timer kill code. I've even thrown in a nice #define for it....

Code:
if (pressTimer != nil) {
[pressTimer invalidate];
pressTimer = nil;

}

#define KILL_TIMER(q) if (q) {[q invalidate]; q=nil;}

If your timer is set to only fire once (repeats:NO) then you must make sure to include pressTimer = nil; in your timer function to flag that the timer is gone.

If you want a setup where a timer fires 5 times then invalidates, you use repeats:YES when creating your timer, then use the userInfo data to keep count, then call invalidate in the timer function when the count in your userInfo object reaches 5.

Yes, in this case userInfo must be an NSObject subclass! So you need to create a really simple class to hold your data. Something like this:

Code:
// TimerCounter - a simple class to assist countdown timers
@interface TimerCounter : NSObject {

int countdown;
}
@property (nonatomic, assign) int countdown;
+ (TimerCounter*)timerCounterWithCount:(int)count;
- (id)initWithCount:(int)count;
- (BOOL)decrementAndTest;
@end

Loading mentions Retweet
Filed under  //  hacking   iphone   iphone sdk   leftrightstudio  
Comments (0)
Posted 6 months ago