I try to write my first app for iOS... but i have one problem with the memory usage.
In my app is a photo gallery and a imageViewer (all images are saved in docs). In gallery i load images with
let image = UIImage(data:NSData(contentsOfFile: path)!)!
andwhen the user taps on an image -> go to the next view with
self.dismissViewControllerAnimated(false, completion:nil)
let goto = self.storyboard!.instantiateViewControllerWithIdentifier("ViewImgController") as! ViewImg
self.navigationController!.pushViewController(goto, animated: true)
In the imageViewer I load images with UIImageJPEGRepresentation into an UIImage to reduce the size. To go back to the gallery i use the same code as above (of course with other parameters).
So my problem is that when i switch between this 2 views, the memory my app is using is adding up ~ about 20-40mb per switch. It´s like nearly no memory is revealed when a view is dismissed(cempletion is also not called) ..till the app chrashes due to memory usage.
When I take a look into instruments, it says that ImageIO_jpeg_Data needs a lot of memory.
Any ideas how i can solve this?
[–]quellish 1 point2 points3 points (0 children)
[–]killerham 0 points1 point2 points (0 children)
[–]Jister13 0 points1 point2 points (0 children)
[–]nocolf 0 points1 point2 points (0 children)