Is there in objective-C any way to see if it is possible to do a certain task without risking crash the application?
Other languages like javascript have
Have a look at Exception Handling :
Cup *cup = [[Cup alloc] init]; @try { [cup fill]; } @catch (NSException *exception) { NSLog(@"main: Caught %@: %@", [exception name], [exception reason]); } @finally { [cup release]; }
Also worth to have a look: Error Handling Programming Guide