February 2011
4 posts
1 tag
Simplify UIView Animation With Categories
What follows is a category I use to animate UIViews. Adding the animation code where the animation happens feels very messy to me. With these simple categories you can cut down the animation of a UIView in certain situations to a single line of code. @interface UIView (Extra) // Animate removing a view from its parent - (void) removeWithTransition:(UIViewAnimationTransition) transition...
Feb 22nd
1 note
1 tag
Managing Color With UIColor Categories
I find it nice to have all the colors for my application contained in one file. This makes it easy to tweak the colors of the app without hunting. How I do this, is to create a Colors.h file and import it in the prefix.pch file. The prefix.pch file is located in “other sources” by default in a new xcode project. The file should look something like this… #ifdef...
Feb 15th
2 notes
1 tag
Custom UITableViewCell Without Subclassing
I was going to do another game dev post today, but because of a lack of time I will be doing a short tutorial on customizing a UITableViewCell without subclassing. I find myself in a position frequently where I want to add a label or image to a table cell. You can easily subclass UITableViewCell and add as many other components as you want. I don’t like this solution for adding just a few...
Feb 8th
1 note
Building a Platform game with Corona and Lime
**Update** - Added Corona Project Minus Lime Source Code You can download the project I will be working with here. This does not include the Lime source code, you will have to buy that yourself here. Note: I have been coding in lua for about a week now. Please let me know if you find anything incorrect or bad practice. In this tutorial I will be walking you through the code needed to create a...
Feb 1st
January 2011
3 posts
Naked Match Experiment Part 2
I was just told yesterday by @mysterycoconut that I am up for #iDevBlogADay on Tuesdays now. He gave me the option of starting next week but I figured I could come up with something to post today. I decided that I would do an update on how Naked Match was doing. You can see my initial post about it here… Naked Match Experiment Part 1 First of all, I am working on a redesign of Naked...
Jan 25th
1 note
Problems With .js Files in XCode
Do you find your self seeing the following error after adding a javascript file to your project? warning: no rule to process file ‘$(PROJECT_DIR)/Resources/textView.js’ of type sourcecode.javascript for architecture armv6 Fear not for this is an easy fix. Select the .js file and click the details tab. In the detail view uncheck the bullseye column (the last to the right). This...
Jan 5th
2 tags
Jan 4th
December 2010
2 posts
1 tag
Passcode Entry Screen iOS
I was recently asked to create a passcode screen for Tumble Photo. Since there is adult content on tumblr, the user wanted the ability to lock down the app with a passcode. I googled for a bit, thinking that someone had to have already done this. No luck, so here is the results of what I came up with. This can be used to set the passcode as well as to authenticate the passcode. I tried to get it...
Dec 29th
1 note
2 tags
Tumble Photo Available in the App Store Now!
My new app has just passed Apple review. Tumble Photo is a simple Tumblr image gallery viewer for the iPad, iPhone, and iPod touch. View all the image posts from your favorite tumblr Tumblelog in an easy to use image gallery app. Download it now Free! http://itunes.apple.com/us/app/tumble-photo/id398357516?mt=8
Dec 16th
2 notes
November 2010
3 posts
1 tag
Check if Current Device is iPad
This is a simple method I use in all my apps to easily tell if the current device is iPad. I add the import for this class to the Prefix.pch file so I can easily check what device I am on without having to import. //Device.h @interface Device : NSObject { } + (BOOL) isPad; @end //Device.m #import "Device.h" @implementation Device + (BOOL) isPad { #ifdef UI_USER_INTERFACE_IDIOM return...
Nov 19th
1 note
1 tag
Core Data QuickTip: Inverse Relationships →
brandontreb: One thing I always wondered about Core Data is why the compiler would warn you if you didn’t specify the inverse relationship. After reading through Apple’s docs, they essentially say its to make your database more robust by reinforcing those relationships. Plus, you never know when you may have…
Nov 12th
3 notes
1 tag
Check if NSString Contains a Sub String
This is a simple category that allows you to see if an instance of NSString contains a specific sub string. @interface NSString (SubString) - (BOOL) hasSubString:(NSString *) str; @end @implementation NSString (SubString) - (BOOL) hasSubString:(NSString *) str { return [self rangeOfString:str].location != NSNotFound; } @end
Nov 8th
1 note
October 2010
1 post
1 tag
Automate iOS Builds With ANT
This is a simple tutorial on how to automate an iOS build with ANT. ‘Why ANT,’ you ask? Because ANT rocks. Coming from the world of Flex development, I am very comfortable with ANT. I have used ANT to compile and deploy Flex application many times. ANT is simple. Install it, write a simple xml file, and run it. What you need TextMate (30 Day trial) TextMate ANT Bundle Step 1: Install...
Oct 29th
4 notes
August 2010
9 posts
3 tags
Wandering NPCs!
Aug 26th
3 tags
AAS Editor Demo
For my #iDevBlogADay post this week I decided to do a screen cast. I wanted to give an update on my progress with the AAS engine. This is my first ever narrated screen cast, so be gentle :). Below the screen cast is a demo video showing the game in action inside the AAS. Enjoy!
Aug 22nd
2 tags
Aug 17th
2 tags
Aug 16th
2 tags
Finite State Machine Part 1
Intro I would like to start by saying, I am not a computer scientist. The only degree I have is an Associates in visual communications. I am a self taught developer and have no formal training in any kind of programming. What follows is my understanding and implementation of a Finite State Machine (FSM). That being said, I am open to corrections and suggestions. Also a lot of this is based...
Aug 15th
2 tags
Awesome Adventure System
iDevBlogADay I am pleased to announce that I will be participating in the iDevBlogADay. I will be posting every Sunday to keep my spot on the iDevBlogADay.com list. Stay tuned, maybe I can get in the habit of posting more regularly. The Awesome Adventure System Lately, I have been rethinking my adventure game idea. I have come to the conclusion that I will build an adventure game system. I...
Aug 8th
1 note
3 tags
New Review Section
I just added a new section to this site for reviews. I have decided to start doing some mini reviews of apps that I find of interest. I don’t think I will be taking requests for reviews though. My main focus in this area will be app that catch my attention. So stay tuned for the first app review!
Aug 5th
3 tags
Naked Match Experiment Part 1
My Memory I am not sure how many of my readers out there remember my game My Memory. My Memory is a simple pair matching game. The difference is, you use your own images and they show full size behind a semitransparent set of buttons. My Memory is not even in the App Store anymore and it is still making me more money than Artifice. How can that be? Well, when I submitted My Memory to the...
Aug 5th
1 note
3 tags
Naked Match Now Available FREE!!
http://itunes.apple.com/us/app/naked-match/id367652494?mt=8
Aug 2nd
July 2010
7 posts
4 tags
Turn Off Xcode Undo Warning
I am not sure how many other people get irritated when trying to undo in Xcode. When you save a file you always get a prompt that asks if you want to undo after a save. Running this simple command in Terminal will get rid of that annoying warning. defaults write com.apple.Xcode XCShowUndoPastSaveWarning NO You will have to restart Xcode after changing this setting.
Jul 30th
5 notes
2 tags
Weezy World An Adventure Game
I am in the initial planning phase of a new game Weezy World. This is a working title and I don’t know if I will change it. The general idea of it is to create a Kings Quest V style game with a twist. I love top down tile based games in the perspective of Zelda. I was thinking it would be cool to have that type of world but have the control scheme of Kings Quest V. For those of you not...
Jul 17th
3 tags
UITableViewCell Multiline Text
- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *) indexPath { UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:@"Cell"]; if(cell == nil) { cell = [[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"Cell"]; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.textLabel.font =...
Jul 15th
3 tags
OpenFeint Multiplayer Integration Into Artifice
So, OpenFeint finally added turn based multiplayer into their SDK. I can now finally ditch Google App Engine and Urban Airship! WOO HOO!!! Don’t get me wrong, these are not bad services. I have actually found them to be quite nice. They can however both cost money, and the App Engine app is more code to maintain. Personally I would prefer to work on the client side over the server side any...
Jul 15th
3 tags
UIToolBar Hide / Show UIBarButtonItem
BOOL active = YES; NSMutableArray *items = [NSMutableArray arrayWithArray:toolBar.items]; BOOL found; for(int i = 0; i < items.count; i++) { UIBarButtonItem *item = (UIBarButtonItem *)[items objectAtIndex:i]; if([item isEqual:myButton]) found = YES; } if(found && !active) [items removeObjectAtIndex:myButtonIndex]; if(!found && active) [items...
Jul 14th
1 tag
NSNotification Management
Coming from the world of Flash/Actionscript I really like the concept of NSNotifications in iPhone apps. Problem is, keeping track of your notifications can become a pain real quick. That is why I like to create a centralized location to manage all my NSNotifications. More after the jump. First we will create our header. (Read comments) @interface ApplicationNotifications : NSObject { } //...
Jul 2nd
4 tags
UIScrollView Image Gallery Tutorial
Using a UIScrollView to create a paging application seems to be a question I am frequently asked about. I decided to create this tutorial to show how you can create an image gallery with a UIScrollView. I will show you have to reuse two UIImageViews views to avoid creating a UIImageView for each image in the gallery. Full tutorial and source after the jump. I will highlight the most important...
Jul 1st
1 note
June 2010
8 posts
3 tags
UITextView resignFirstResponder If...
Sometimes you need to know if a UITextView is activly being edited. Here is a simple snippet to check if a UITextView is the first responder if it is then resign it. This will dismiss the keyboard and cancel editing of the UITextView. if([myTextView isFirstResponder])[myTextView resignFirstResponder];
Jun 29th
3 tags
To iPhone 4 Or Not iPhone 4
I am probably one of the only iPhone developers who doesn’t own an iPhone. That sounds pretty strange, but I have been using my 1st gen iPod touch pretty much exclusively for development. This puts a damper on things with the release of the iPhone 4 and the new iOS 4. Apple is not supporting the 1st gen iPod touch anymore, which means no upgrade. Now it’s time to buy a new device. The...
Jun 11th
3 tags
iPhone SDK UIWebView Alert
I found myself needing a quick way to show a simple web page in my apps. I created this custom UIAlertView to do just that. Code after the jump. @interface WebAlert : UIAlertView { @private UIWebView *alertWeb; UIActivityIndicatorView *activityIndicator; } - (void) loadURL:(NSString *) url; @end #import "WebAlert.h" @implementation WebAlert - (void) loadURL:(NSString *)...
Jun 11th
3 tags
iPhone SDK Random UIColor
Sometimes when testing things out you just need to give something a random background color. Here is a snippet for generating a random UIColor. Found At // UIColor+Random.h @interface UIColor (Random) + (UIColor *) randomColor; @end // UIColor+Random.m #import "UIColor+Random.h" @implementation UIColor (Random) + (UIColor *) randomColor { CGFloat red = ...
Jun 9th
4 tags
Artifice Open Source!
I have decided to make my iPhone game Artifice open source. Due to family obligations I can no longer support this game. This work is licensed under a Creative Commons Attribution 3.0 Unported License. You may use this code in any way you want. All I ask is a credit for the work I did with a link to kwigbo.com. Features Cocos2d / UIKit mixture OpenFeint integration Push Notifications via Urban...
Jun 9th
6 notes
3 tags
iPhone SDK Memory Management
Here is a great article on memory management in Objective-C Memory Management
Jun 8th
3 tags
iPhone SDK Get Path For File
Here are two snippets that show how to get the path for a file in the documents directory or the main bundle. // Main Bundle NSString *pathInMainBundle = [[NSBundle mainBundle] pathForResource:@"example" ofType:@".png"]; // Documents Directory NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docsDir = [documentPaths...
Jun 8th
3 tags
Check If A File Exists
This simple snippet use the NSFileManager to check if a file exists. NSFileManager *fileManager = [[NSFileManager alloc] init]; BOOL exists = [fileManager fileExistsAtPath:@"Path To File"]; [fileManager release];
Jun 8th
May 2010
1 post
3 tags
Convert Seconds To Minutes String
- (NSString *) secondsToMinutesString:(int) seconds { NSString *secStr; if(seconds % 60
May 25th
April 2010
1 post
3 tags
Resize a UIImage the right way
This is a great article about resizing a UIImage. It also includes some good insight into general iphone development as well. http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/
Apr 28th
3 notes
March 2010
4 posts
2 tags
Promote Your Game FREE!
**Offer Expired** I am looking for a few good games to promote through the more games section in ABC123 and Artifice. ABC123 is scheduled to be the OpenFeint free game of the day (http://freegameoftheday.com/) on March 24th. Artifice is scheduled to be the free app of the day on freeappaday.com on April 6th. Both Artifice and ABC123 are cross promoted through the more games section in each game....
Mar 21st
3 tags
Rectangle To Rectangle Collision Detection
There is a built in method for testing collisions between rectangles. BOOL colide = CGRectIntersectsRect(rect1, rect2); Here is a method I wrote before I new the former had existed. - (BOOL) rect:(CGRect) rect collisionWithRect:(CGRect) rectTwo { float rect_x1 = rect.origin.x; float rect_x2 = rect_x1+rect.size.width; float rect_y1 = rect.origin.y; float rect_y2 =...
Mar 4th
2 notes
2 tags
Comparison Of XML Parsers For The iPhone SDK
http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project
Mar 4th
3 tags
iPhone SDK Using Hex Values For UIColor
Here is a simple category to make using hex values for UIColor easier. // UIColor+Hex.h @interface UIColor (Hex) + (UIColor *) colorWithHex:(uint) hex; @end // UIColor+Hex.m #import "UIColor+Hex.h" @implementation UIColor (Hex) + (UIColor *) colorWithHex:(uint) hex { int red, green, blue, alpha; blue = hex & 0x000000FF; green = ((hex & 0x0000FF00) >> 8); red = ((hex...
Mar 3rd
3 notes
February 2010
7 posts
2 tags
iPhone SDK UIAlertView With Activity Indicator
Looking for a quick and easy way to show an activity indicator? I found the easiest way was to subclass UIAlertView to make a reusable solution. Click read more for the code. // ActivityAlertView.h @interface ActivityAlertView : UIAlertView { UIActivityIndicatorView *activityView; } @property (nonatomic, retain) UIActivityIndicatorView *activityView; - (void) close; @end //...
Feb 17th
3 notes
5 tags
Easy custom UITableView drawing
Great tutorial from Cocoa with Love http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
Feb 15th
3 notes
5 tags
Artifice 2.0.1 Submitted To The App Store
I submitted a new version of Artifice this weekend. There are a bunch of new things to look forward to. AI crash fixed New game and continue game screens rebuilt and optimized Friends are alphabetized when choosing a friend to challenge Double tap game board for settings Walk time control Drag sensitivity control OpenFeint acheivement (Ranks for winning online games) OpenFeint...
Feb 15th
2 notes
4 tags
Artifice Crash Bug Fixed
Some users of Artifice have reported a crash when trying to play against the device AI. I found the cause of this crash and it will be fixed with the next release. I will be submitting a new version to the App Store this weekend. In the meantime there is a workaround. When you go to the choose opponent screen wait till your list of friends is done loading before selecting Device AI. When the list...
Feb 10th
2 notes
4 tags
Finding Memory Leaks In An iPhone App
Here is a great tutorial from Mobile Orchard on using Instruments to find memory leaks. http://www.mobileorchard.com/find-iphone-memory-leaks-a-leaks-tool-tutorial/
Feb 9th
2 notes
4 tags
Artifice 2.0 Has Hit The App Store!
Last night Artifice passed Apple review in record time. At least it’s a record for me. Usually I get rejected the first time for some small thing. This time it got through the review process in 5 days.
Feb 5th
5 tags
Artifice 2.0 In Review
The @openfeint multiplayer version of Artifice is now in the hands of Apple reviewers. Hopefully things go well. Everyone who already has downloaded it will get the multiplayer for free. The price will be going up to .99$ when it hits the App Store. Get it now while it’s still free! Get Artifice
Feb 2nd