Skip to content
Cocoa Maker 7 - Libraries and Frameworks episode artwork

EPISODE · Apr 13, 2010

Cocoa Maker 7 - Libraries and Frameworks

from Cocoa Maker · host Mr. Gecko

James (MrGeckosMedia.com), joined by, Eduardo (MegaEduX.com), and Nick, explains libraries and frameworks. 11:56 Example code from episode. Libraries Libraries included, /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib #import <Foundation/Foundation.h> #import <openssl/evp.h> 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<templen; i++) { [md5 appendFormat:@"%x", outbuf[i]]; } NSLog(@"MD5 of %@ is %@", string, md5); [pool drain]; return 0; } Frameworks Frameworks included, AddressBook.framework #import <Foundation/Foundation.h> #import <AddressBook/AddressBook.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; ABAddressBook *addressBook = [ABAddressBook sharedAddressBook]; NSArray *people = [addressBook people]; for (int i=0; i<[people count]; i++) { ABPerson *person = [people objectAtIndex:i]; NSString *firstName = [person valueForProperty:kABFirstNameProperty]; NSString *lastName = [person valueForProperty:kABLastNameProperty]; NSString *name = nil; if (firstName!=nil) { name = firstName; if (lastName!=nil) name = [name stringByAppendingFormat:@" %@", lastName]; } if (name!=nil) NSLog(@"Person named: %@", name); } [pool drain]; return 0; } Keynote used in this Episode Keynote in PDF Format

Episode metadata supplied by the publisher feed · Published Apr 13, 2010

Embed this episode

Ready to play

Cocoa Maker 7 - Libraries and Frameworks

0:00 0:00

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

AI, Government, and the Future Corner Alliance Welcome to AI, Government, and the Future, a podcast by Corner Alliance. We explore the intersection of artificial intelligence, government, and the future. Join us as we dive into the latest AI advancements, government policies, and innovative strategies to shape the future of our society. Whether you're a policy maker, venture capitalist, academic, or industry leader, this podcast will provide valuable insights and thought-provoking discussions to help you navigate the evolving landscape of AI and its impact on government. Tune in to AI, Government, and the Future to stay ahead in this transformative era. The Bootloader Paul Cutler and Tod Kurt A monthly podcast loading you up with news, project updates and product talk from the CircuitPython and maker communities. Hosted by Tod Kurt and Paul Cutler. Hack Learning Mark Barnes Learn quick and easy ways to improve education, leadership, and parenting: How to replace traditional homework; how to improve leadership; how to integrate new technology; how to assess for learning; how to eliminate useless meetings; how to engage even the most reluctant learners; how to inspire a lifelong love of reading; how to combine writing with the maker space; how to take learning mobile; how to improve social media strategies. Teacher/author/global influencer Mark Barnes, creator of the Bestselling Hack Learning Book Series, explains precisely what's wrong with education and what you can do about it, tomorrow; because you don't need a 5-year plan. Learn more at http://10publications.com.

Frequently Asked Questions

When was this Cocoa Maker episode published?

This episode was published on April 13, 2010.

Can I download this Cocoa Maker episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!