objective c - Iphone : How to Display Document Directory images in Image View? -
objective c - Iphone : How to Display Document Directory images in Image View? -
in app images stored in document directory folder,
i wanted particular image display in image view,
how image display in image view document directory ?
sample code:
- (nsstring *)applicationdocumentsdirectory { homecoming [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
iphone objective-c cocoa-touch ios4
Comments
Post a Comment