Question: Hi I am not sure what's wrong with pushing the new element to associative array of objects

```
var storeData3 = [  
{ 'key1' : 'value1' },  
{ 'key2' : 'value2' },  
{ 'key3' : 'value3' },  
{ 'key6' : null},  
{ 'key7' : ''},  
{ 'key8' : ""},  
{ 'key9' : null},  
{ 'key10' : 'value4'}
]; //as JSON object

var i=0;

storeData3=JSON.stringify(storeData3, function(key, value)
{if(!value)
{
    i++;

};

return value;
});

JSON.parse(storeData3);

function insert(name, number) 
{
    storeData3.push({name: number});        
}

if(i>0) insert('keyX','null');

```

The errors says "TypeError: storeData3.push is not a function".

Answer: 
```
// Download Image from Remote Server
NSURL *url = [NSURL URLWithString:@"Your IMAGE URL HERE"];
NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"moon" ofType:@"jpg"]];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libPath = [paths objectAtIndex:0];
NSString *filePath = [libPath stringByAppendingPathComponent:[url lastPathComponent]];
BOOL status = [data writeToFile:filePath atomically:YES];
// Save Image file to Library Directory, if success then store infor about it in file
if(status)
{
    // If File Exist then read it otherwise creat new
    NSMutableDictionary *imageInfoDict;
    if([[NSFileManager defaultManager] fileExistsAtPath:[libPath stringByAppendingPathComponent:@"imageInfo.plist"]])
    {
        NSData *fileData = [NSData dataWithContentsOfFile:[libPath stringByAppendingPathComponent:@"imageInfo.plist"]];
        imageInfoDict = [NSMutableDictionary dictionaryWithDictionary:[NSKeyedUnarchiver unarchiveObjectWithData:fileData]];

        // To set As Background Load image from disc
        // Read filename from Dictionary, but you must know the key which you want to get
        NSString *fileName = imageInfoDict[@"68051_10151509108346729_1731694342_s.png"][@"imagePath"];
        // Set your image as background
        UIImage *image = [UIImage imageWithContentsOfFile:[libPath stringByAppendingPathComponent:fileName]];
    }
    else
        imageInfoDict = [NSMutableDictionary dictionaryWithCapacity:0];

    // Create Dictionary to store Single Image Info
    NSDictionary *imageInfo = [NSDictionary dictionaryWithObjectsAndKeys:[url lastPathComponent], @"imagePath",
                               [url lastPathComponent], @"imageName",
                               [NSDate date], @"date",nil];
    // Add Single Image Info to Main Dictionary
    [imageInfoDict setValue:imageInfo forKey:[url lastPathComponent]];

    // Convert Main info Dictionary to `NSData` to Save on Disc
    NSData *fileData = [NSKeyedArchiver archivedDataWithRootObject:imageInfoDict];
    // Save file to Disc
    [fileData writeToFile:[libPath stringByAppendingPathComponent:@"imageInfo.plist"] atomically:YES];

    // Read Info From File
    NSLog(@"%@",[NSDictionary dictionaryWithContentsOfFile:[libPath stringByAppendingPathComponent:@"imageInfo.plist"]]);
}

```
Many ways are there depending upong your requirements

1) SQLITE : Save you image meta data in a table along with the file name in a row

2) NSUserDefaults : If number of images is pretty less

3) Text File : Write you Data separated by a new line, which should also not be difficult, again depends on your requirements.

Hope this helps.