ios - Try to return string value from - ( void) captureoutput and then output it to a uitableview -


i doing ios exercise , trying bar-code data stored in nsstring detectionstring , output tableview. have declared @property nsstring* detectionstring in tableview method not coming up

- (void)captureoutput:(avcaptureoutput *)captureoutput didoutputmetadataobjects:(nsarray *)metadataobjects fromconnection:(avcaptureconnection *)connection     {         cgrect highlightviewrect = cgrectzero;         avmetadatamachinereadablecodeobject *barcodeobject;         nsstring *detectionstring = nil;         nsarray *barcodetypes = @[avmetadataobjecttypeupcecode, avmetadataobjecttypecode39code, avmetadataobjecttypecode39mod43code,                                   avmetadataobjecttypeean13code, avmetadataobjecttypeean8code, avmetadataobjecttypecode93code, avmetadataobjecttypecode128code,                                   avmetadataobjecttypepdf417code, avmetadataobjecttypeqrcode, avmetadataobjecttypeazteccode];            (avmetadataobject *metadata in metadataobjects) {             (nsstring *type in barcodetypes) {                 if ([metadata.type isequaltostring:type])                 {                     barcodeobject = (avmetadatamachinereadablecodeobject *)[_scanpreviewlayer transformedmetadataobjectformetadataobject:(avmetadatamachinereadablecodeobject *)metadata];                     highlightviewrect = barcodeobject.bounds;  **// string contains barcode data -->**                    self.detectionstring = [(avmetadatamachinereadablecodeobject *)metadata stringvalue];                      break;                 }             }             // conditional statement test if barcode scanning                  if (detectionstring != nil)                 {                     _scanlabel.text = detectionstring;                      break;                 }                 else                     _scanlabel.text = @"nil";              }              _scanlasercaptureview.frame = highlightviewrect;       }       - (nsstring *)detectionstring      {   **//stored string value, want appear on tableview method**         return _detectionstring;     } 

once detection string reload table , cells pass detection string in cellforrowatindexpath.