In a App images stored in Document Directory Folder,
I wanted Particular image display in Image view,
How that image Display in Image View from the Document Directory ?
sample code:
- (NSString *)applicationDocumentsDirectory { return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; } -(void)loadimage{ NSString *workSpacePath=[[self applicationDocumentsDirectory] stringByAppendingPathComponent:@"your image-name"]; UIImageView *myimage=[UIImageView alloc] initWithFrame:CGRectMake(0,0,20,20)]; myimage.image=[UIImage imageWithData:[NSData dataWithContentsOfFile:workSpacePath]]; [self.view addSubView:myimage]; [myimage release]; }
TNQ
1.4m articles
1.4m replys
5 comments
57.0k users