Need assistance regarding objective-c and opps concept <p>Currently I am working on messaging app, which send text messages, image and audio files.</p> <p>Files get uploaded on http server, for downloading and uploading I am using NSURLConnection. </p> <p>When user tap download button I extract out the cell of table view and add progressview as a subview like this</p> <p><strong>In header file</strong></p> <pre><code>@property (strong, nonatomic) UIProgressView *progress; </code></pre> <p><strong>In Class File my download method</strong></p> <pre><code>progress = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleBar]; progress.trackTintColor = [UIColor grayColor]; progress.frame = CGRectMake(10, 50, 160, 30); progress.progress = 0.0; [cell addSubview:progress]; </code></pre> <p><strong>When data is received this NSURLConenction delegate method get called</strong></p> <pre><code>-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { if(imgUpload) { NSLog(@"UPLOAD"); } else { [self.resourceData appendData:data]; NSNumber *resourceLength = [NSNumber numberWithUnsignedInteger:[self.resourceData length]]; [self.progress setProgress:[resourceLength floatValue] / [self.filesize floatValue] animated:YES]; } } </code></pre> <p>If there are more then one file and every time user tap on the download button this whole code will execute and progressview will be added to that cell, but all are referred through <strong>progress</strong> variable. <strong>How every individual progressview is identified uniquely</strong>. If I try to download three files all progressview indicate there own progress and works fine.</p> <p>Please clear this concept.</p> <p><strong>Yes under the hood data is messing up, I tried to download audio and image file together but ended up with corrupt files.</strong></p> <p><strong>Please provide a example how to solve this issue.</strong></p>