Archive for the ‘Uncategorized’ Category

January 27, 2011 0

New Stanford course is online

By admin in Uncategorized

I learned a lot by watching the original course, nothing like having someone explain in lecture form, after reading about these concepts for a while. And now it looks like, they’ve updated the course. The new instructor has a more calm style, seems like it will be good. http://itunes.apple.com/us/itunes-u/developing-apps-for-ios-sd/id395631522 This is from the first few minutes [...]

Tags:

October 30, 2010 0

Better NSLog – Adding function name / line number to NSLog

By admin in Uncategorized

When tracking down a bug, the most useful way to start checking things is to NSLog something. I’m a heavy user of breakpoints and the debugger. I can’t live without it, and it’s saved me countless hours. However I usually see if i can NSLog something first perhaps the problem was an obvious one. A [...]

Tags:

October 26, 2010 4

The best form submission class (asi-http-request)

By admin in Uncategorized

Small but quick snippet here. Sending multi-part form with image data: NSString *imagePath = NSString *imagePath = [NSString stringWithFormat:@"%@/%@", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject], @"junny.png"];   UIImage *image = [UIImage imageWithContentsOfFile:imagePath]; NSData * imageData = UIImageJPEGRepresentation(image, 0.75)   ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:http://example.com/form.php]]; [request setPostValue:@"I like brains!" forKey:@"title"]; [request setPostValue:[NSString stringWithFormat:@"%@", [NSDate date]] forKey:@"session"];l [request [...]

Tags:

October 14, 2010 0

Parsing Delimited String from XMLNode on iOS using GDataXMLNode

By admin in Uncategorized

Often when you work with XML, you need to put a bunch of values into a node, maybe positioning information for example. The best way to do that is to create a “Delimited String”, that is “ABC|123|XYZ|987″, is delimited by the | character. Here’s how you get that back in iOS into an array, that [...]

Tags:

October 6, 2010 0

Post-A-Day #10 UIViewController’s views

By admin in Uncategorized

-(void) someEventDidOccur EditOptionsViewController *anEditOptionsViewController = [modalViewControllers_ objectForKey:@"someName"];   // A little note about retain/release // views are not aware of their UIViewController // When they don’t have one, and .view is requested UIViewController will simply create a new one. // In the code below, if the order were reversed, "anEditOptionsViewController" would be dealloced // // [...]

Tags:

October 5, 2010 0

Post-A-Day #9 – Blocks Part 1

By admin in Uncategorized

In objective-C a Block is a type of closure. A closure, is a method that contains state information, using free variables. It binds the variables for you on the stack, so in that sense it “closes” the expression. To give an example in javascript you could call setTimeout this way: function callLater(first, second, third) { [...]

Tags:

October 3, 2010 1

Post-A-Day #8 – Allow superview to recieve events caught by subview.

By admin in Uncategorized

I had a problem in my current project related to this, and it was a good opportunity, to learn a little bit more about how touches are handled in iOS. Enter UIResponder UIResponder is the Class any objects that which to receive events must Subclass, if they wish to receive (among other types) TouchEvents from [...]

Tags:

September 26, 2010 0

Post-A-Day #6 – UIViewController subview is 20 pixels too high!!!

By admin in Uncategorized

This is a small tip which I’ve encountered twice so far on my current project, and a few times before. The times were far apart enough, that by the time I encountered it again I forgot what the solution was. Just that it was fixible….er somehow. Problem: -You created a new class of UIViewController type, [...]

Tags:

September 21, 2010 17

Post-A-Day #5, UIKit + Cocos2d – View Based Cocos2D Application

By admin in Uncategorized

Introdction Cocos2D is awesome, and it even comes with some amazing templates to create 3 different kinds of projects. Vanilla version, one that combines Box2d(physics engine), and one that combines it with Chipmunk (physics engine). I see a lot of games that use Cocos2D exclusively from beginning to end, and by default that’s more or [...]

Tags:

September 20, 2010 0

Post-A-Day #4 – Objective-C Flocking-Behaviors/Boid Class

By admin in Uncategorized

http://onedayitwillmake.com/blog/2010/09/post-a-day-4-objective-c-flocking-behaviorsboid-class/

Tags: