Why do I get an OutOfMemoryException when I have images in my ListBox?

Oh, I recently killed whole day to make this working! So the solution is: Make your Image control free resources. So set the BitmapImage bitmapImage = image.Source as BitmapImage; bitmapImage.UriSource = null; image.Source = null; as it was mentioned before. Make sure you virtualize _bitmap on every item of the list. You should load it … Read more

Get all of the pictures from an iPhone photoLibrary in an array using AssetsLibrary framework?

//View Controller header(.h) file.. #import <UIKit/UIKit.h> #include <AssetsLibrary/AssetsLibrary.h> @interface getPhotoLibViewController : UIViewController { ALAssetsLibrary *library; NSArray *imageArray; NSMutableArray *mutableArray; } -(void)allPhotosCollected:(NSArray*)imgArray; @end //implementation file declare global count variable as static int count=0; @implementation getPhotoLibViewController -(void)getAllPictures { imageArray=[[NSArray alloc] init]; mutableArray =[[NSMutableArray alloc]init]; NSMutableArray* assetURLDictionaries = [[NSMutableArray alloc] init]; library = [[ALAssetsLibrary alloc] init]; void (^assetEnumerator)( … Read more