Artwork

Content provided by Mr. Gecko. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Mr. Gecko or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!

Cocoa Maker 7 - Libraries and Frameworks

 
Share
 

Manage episode 155736466 series 1166832
Content provided by Mr. Gecko. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Mr. Gecko or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
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 #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; iFrameworks
Frameworks included, AddressBook.framework
#import #import 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
  continue reading

7 episodes

Artwork
iconShare
 
Manage episode 155736466 series 1166832
Content provided by Mr. Gecko. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Mr. Gecko or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
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 #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; iFrameworks
Frameworks included, AddressBook.framework
#import #import 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
  continue reading

7 episodes

All episodes

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Quick Reference Guide