This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "MySingleton.h" | |
@implementation MySingleton | |
// Referencia al singleton | |
static MySingleton *_sharedSingleton = nil; | |
// Regresa la instancia singleton | |
+ (MySingleton *)sharedSingleton | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Crear alerta, asignar delegate y tag | |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" | |
message:@"You must register a Facebook account first" | |
delegate:self | |
cancelButtonTitle:@"Cancel" | |
otherButtonTitles:@"OK"]; | |
alert.tag = 101; | |
[alert show]; | |
[alert release]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Agrega metodo para mapear lo que recibes de la API con atributos de una clase | |
- (RKManagedObjectMapping *)objectMappingForPublishedID | |
{ | |
RKManagedObjectMapping *objectMapping = [RKManagedObjectMapping mappingForEntityWithName:@"Publication"]; | |
[objectMapping mapKeyPath:@"account" | |
toAttribute:@"account"]; | |
[objectMapping mapKeyPath:@"status_id" | |
toAttribute:@"statusID"]; | |
return objectMapping; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOOL emptyTextFields(id toCompare,...) | |
{ | |
va_list args; | |
va_start(args, toCompare); | |
id value = nil; | |
BOOL match = NO; | |
while ( (value = va_arg(args,id)) ){ | |
if( [toCompare isKindOfClass:[NSString class]] && [value isKindOfClass:[UITextField class]] ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Crear un navigation controller usando un XIB | |
// Primero se debe crear el view controller inicial (root view controller) | |
// MyViewController cuenta con un archivo xib | |
MyViewController *viewController = [[MyViewController alloc] init]; | |
// Se crear el navigationController para presentar el viewController | |
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on https://code.tutsplus.com/articles/securing-communications-on-ios--cms-28529 | |
import Foundation | |
import Security | |
struct Certificate { | |
let certificate: SecCertificate | |
let data: Data | |
} |