ios - UIAlertView wait until name entered -


i have small problem, looks thread can sort it, i'm not in threads, read many tutorials, still didn't idea how sort it. scenario is: saving file amazon s3, , it's working perfect, decide before uploading file amazon, give user enter file name, , when call uialertview class, program keep running, , saving file @"test.txt". here part of code:

filenmae = @"test.txt"; filename = [self getfilename]; nslog(@"file name %@", filename);  /// ----------------------------------- /// uploading file amazon cloud !!!! /// ----------------------------------- ... 

and here alert method:

-(nsstring*) getfilename {       // alert method  return @"somefile.name"; } 

thanks

getfilename call alert , delegete methode called when user press ok. implement delegate of alertview in .m

@interface viewcontroller :uiviewcontroller<uialertviewdelegate> 

and call method

-(void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex{      /// -----------------------------------     /// uploading file amazon cloud !!!!  once user press ok on alert upload start     /// ---------- } 

Comments