Cocoa Maker is a Podcast to teach you how to make applications using Cocoa that starts from the beginning to the end. We will teach you things from Memory Management to the Syntax of Cocoa it self.
James (MrGeckosMedia.com), joined by, Eduardo (MegaEduX.com), and Nick, explains libraries and frameworks.11:56Example code from episode.LibrariesLibraries included, /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib#import #import int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSString *string = @"Hello"; OpenSSL_add_all_algorithms(); unsigned char outbuf[EVP_MAX_MD_SIZE]; unsigned int templen, inlen = [string length]; const char *input = [string UTF8String]; EVP_MD_CTX ctx; const EVP_MD *digest = EVP_md5(); if(!digest) { NSLog(@"cannot get digest with name MD5"); return 1; } EVP_MD_CTX_init(&ctx); EVP_DigestInit(&ctx,digest); if(!EVP_DigestUpdate(&ctx,input,inlen)) { NSLog(@"EVP_DigestUpdate() failed!"); EVP_MD_CTX_cleanup(&ctx); return 1; } if (!EVP_DigestFinal(&ctx, outbuf, &templen)) { NSLog(@"EVP_DigesttFinal() failed!"); EVP_MD_CTX_cleanup(&ctx); return 1; } EVP_MD_CTX_cleanup(&ctx); NSMutableString *md5 = [NSMutableString string]; for (int i=0; i
James (MrGeckosMedia.com), joined by, Noah (RockntheSweater.com), and Karl, explains how file managing works in c and cocoa.7:49Example code from episode.Files C Example#import BOOL file_exist(const char *fileName) { FILE *file = fopen(fileName, "r"); if (file) { fclose(file); return YES; } return NO;}int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; const char *ourFile = [[@"~/Desktop/file.txt" stringByExpandingTildeInPath] UTF8String]; FILE *file; if (!file_exist(ourFile)) { file = fopen(ourFile, "w"); time_t currTime = time(NULL); fprintf(file, "%s: We just made this file.n", ctime(&currTime)); } else { file = fopen(ourFile, "a"); } time_t currTime = time(NULL); fprintf(file, "%s: Here is a new line in this file.n", ctime(&currTime)); fclose(file); [pool drain]; return 0;}Files Cocoa Exmaple#import int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSFileManager *manager = [NSFileManager defaultManager]; NSString *ourFile = [@"~/Desktop/file.txt" stringByExpandingTildeInPath]; NSFileHandle *file; if (![manager fileExistsAtPath:ourFile]) { [manager createFileAtPath:ourFile contents:nil attributes:nil]; file = [NSFileHandle fileHandleForWritingAtPath:ourFile]; [file writeData:[[NSString stringWithFormat:@"%@: Here is a new file.n", [NSDate date]] dataUsingEncoding:NSUTF8StringEncoding]]; } else { file = [NSFileHandle fileHandleForWritingAtPath:ourFile]; [file seekToEndOfFile]; } [file writeData:[[NSString stringWithFormat:@"%@: Here is a new line.n", [NSDate date]] dataUsingEncoding:NSUTF8StringEncoding]]; [file closeFile]; [pool drain]; return 0;}Keynote used in this EpisodeKeynote in PDF Format
James (MrGeckosMedia.com), joined by, Eduardo (MegaEduX.com), and John (@ZimiPoder), shows how Dictionaries, Arrays and Property Lists works in Cocoa.12:40Example code from episode.#import int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog(@"Array"); NSArray *array = [NSArray arrayWithObjects:@"Orange", @"Apple", @"Banana", nil]; for (int i=0; i
James (MrGeckosMedia.com), joined by, Eduardo (MegaEduX.com), and Karl, teaches how loops, arguments, and goto works in Cocoa.15:35Example code from episode.Loops Example#import int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int i=0; while (i!=2) { NSLog(@"%d", i); i++; } i=0; do { NSLog(@"%d", i); i++; } while (i!=3); NSArray *anArray = [NSArray arrayWithObjects:@"Apples", @"Oranges", @"Grapes", @"Bananas", nil]; for (int d=0; d
James (MrGeckosMedia.com), joined by, Eduardo (MegaEduX.com), Martin (QueenZSoftware.com), John (@zimipoder), and Garrett, teaches how to read the documentation that comes with xcode.10:48Keynote used in this EpisodeKeynote in PDF Format
James (MrGeckosMedia.com), joined by, Eduardo (MegaEduX.com), Noah (RockntheSweater.com), and Martin (QueenZSoftware.com), teaches about the syntax of cocoa, how equations work in cocoa, how to do if statements, functions, and classes.33:56Example code from episode.Example 1 - If Statements and Equations#import int times(int value, int by);int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int value = 1230; NSLog(@"Value: %d", value); NSLog(@"Value: %d", value%500); NSLog(@"Value: %d", value/100); NSLog(@"Value: %d", times(value, 4232)); if (value>1242) { NSLog(@"%d is greater then 1242", value); } else if (value>=1242) { NSLog(@"%d is greater then or equal to 1242", value); } else if (value
James (MrGeckosMedia.com), joined by, Eduardo (MegaEduX.com), Nick, and Karl, teaches the basics of installing Xcode, setting up a project and making a "Hello, World!" command line utility.30:16Example code from episode.#import int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSString *name = @"World"; if (argc>1) { name = [[[NSString alloc] initWithBytes:argv[1] length:strlen(argv[1]) encoding:NSUTF8StringEncoding] autorelease]; } NSLog(@"Hello, %@", name); [pool drain]; return 0;}