32 posts tagged “programming”
After a few months of .NET reporting/SSIS development work, I'm back to an iPhone project this week. One enhancement I added yesterday was a better formatted table section title in a UITableView. Before, the section title is either a bunch of unformatted (also incorrectly by locale) dates (e.g. 2009-09-30), or times (e.g. 14:58) straight from the data source. The enhancement/bug fix is to format the date or time to be locale aware so the title would either be "Wed Sep, 30 2009" or "2:58 PM" if you are in the US.
I started learning Objective-C when Apple released the iPhone SDK over a year ago, and started programming in it seriously at the beginning of this year. While there are many things I like about Objective-C as a OO language, there is one thing that continuously bother me.
- Implement the method without declaring it in the header file. This is (almost) equivalent to private method in C#/Java.
- Declare the method signature in the header file, and implement the method in the .m file. This is like declaring a method public in C#/Java.
UIView
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
NSInteger tapCount = [touch tapCount];
if (tapCount == 2) {
[scrollView_ setZoomScale:zoomScale animated:YES];
}
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesEnded:touches withEvent:event];
[self.nextResponder touchesEnded:touches withEvent:event];
}
Let's say you want to use UIActionSheet to show three buttons to the user with a cancel buttons in a UIView, which itself is managed by a UITabBarController:
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Action Title" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Option 1", @"Option 2", @"Option 3", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[actionSheet showInView:self.view];
[actionSheet release];
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Action Title" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Option 1", @"Option 2", @"Option 3", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
ApplicationDelegate *appDelegate = (ApplicationDelegate *)[[UIApplication sharedApplication] delegate];
UITabBarController *tabBarController = appDelegate.tabBarController_;
[actionSheet showInView:tabBarController.view];
[actionSheet release];
Last Tuesday I travelled down to Philadelphia to speak at the Philly ALT.NET meeting. Brian Donahue, the group organiser, invited me to talk about my experience of developing iPhone application from a .NET perspective. Over 20 people turned up and I was surprised that most of them already owned an iPhone and a Mac (remember this is a .NET group afterall).
When learning a new language/platform/framework, sometimes learning from a book is a good approach. But that depends heavily on picking the 'right' book. What I mean is that the book contains the 'right' amount of content for the reader's skill level. So when I looked for book to learn more about iPhone development, I have something specific in my mind already.
A few months back, I started working on an iPhone app using the beta version of the iPhone SDK. Since then various things got in the way (not to mention the restriction of the old TOS placed on developers so everyone were working in the dark) and I didn't spend any time on it to really finish the app. My interest was revived when I attended the iPhone Tech Talk event in NYC last Tuesday. The sessions were interesting but nothing technical or coding. I learnt a lot more about the process of provisioning an iPhone for development testing and distribution, as well as how to submit app to the iTunes App Store. Most importantly though were that I was able to resolve issues around my personal's Standard and ThoughtWorks' Enterprise applications to the iPhone Developer Program. Now I am able to distribute and test my app on actual phone(s)!
- Mark's DV camera talks to my Macbook Pro via Firewire and record to tape at the same time.
- Ustream.tv's player recognized Mark's camera
- Ability to get onto Microsoft's guest wi-fi network
- Ability to find a place to put the camera that doesn't get into people's view but close enough to get decent sound reception
How time has flied! It has been a year since I joined ThoughtWorks. In the last 12 months, I've:
- Visited ThoughtWorks India in Bangalore
- Worked in 3 totally different projects (.Net desktop app, build & deploy at an enterprise level, and Agile coaching) in 3 different locations (London, Connecticut, New York)
- Became a committer of an Open Source project, DbDeploy.net
- Attended ALT.NET conference in Seattle
- Started ALT.NET NYC with a bunch of great, like-minded developers
- Edited 4 ThoughtWorks IT Matters podcasts
- Helped out with recruitment (code reviews, office interviews, phone interviews)
- Agile project management, planning, estimation (Mingle)
- Presentation and coaching (PowerPoint!, public speaking)
- Build & Deploy (CruiseControl.NET, Cruise, TeamCity, NAnt, MSBuild, PowerShell, etc.)
- iPhone development
- Mocking (NMock, Moq)
- UI Automated testing (Selenium)
I've been using the iPhone SDK since its original release way back in March. Many frustrating moment in the beginning but the recent beta 7 and beta 8 release proved to be ready for prime time. Apple has added many helper classes or helper methods to classes to make it far easier to work with the UI components, which is by far the most frustrating things I encountered. I am still having problem wrapping my head around the idea of Interface Builder but since the apps that I am building do not involve very complex UI, I just hand coded all the UI instead.
- Fix the build time being 1 hours off (probably day time saving bug)
- Better status icons
- Create application icon (currently it uses icon from CCMenu)
- Finish coding the 'Force Build' functionality
- Add startup screen bitmap (so it won't be just a black screen)
- Add auto detect of CruiseControl server (Java, .Net, or Ruby)