Created
March 16, 2012 22:06
-
-
Save frr149/2053122 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-(NSString *) fetchStringFrom: (NSURL *) aURL error: (NSError **) err{ | |
// Haz algo raro que pueda cascar | |
if (YES) { | |
// Se ha producido un error | |
NSDictionary *errorInfo = [NSDictionary dictionaryWithObject:NSLocalizedDescriptionKey | |
forKey:@"Error al hacer algo arriesgado"]; | |
// recordad que se trata de una doble indirección, así que hay que usar *err | |
*err = [NSError errorWithDomain:@"Mi dominio" | |
code:100 | |
userInfo:errorInfo]; | |
return nil; | |
} | |
// Seguir con la ejecución y devolver la cadena que sea | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment