Question: I need to sum the first and second, then the third and fourth then the fifth and sixth elements from an array. 
For example if I get as input int[] {1, 2, 0, 3, 4, -1} I need to compute it to new int[] {3,3,3} 

```
using System;

class Program
{
static void Main()
{
    int[] Arr = new int[] {1, 2, 0, 3, 4, -1};
    int sum = 0;
    foreach(int index in Arr)
    {
        //sum = (Arr[index at 0 position] + Arr[item at 0 position + 1]); 
        //Then do nothing with Arr[index at 1 position]
        //Then sum Arr[index at 2 position] + Arr[item at 3 position];
        //Then do nothing with Arr[index at 4 position]

        //if I test this condition
        // if(Arr[index]%2==0) //here I want to test the actual index of the element, not the value behind the index
        //{skip the next Arr[index]}
        //else{ sum Arr[index]+Arr[index + 1] }

    }
}   

```

}

Answer: 
You can make this by using javascript. by loading a web view in background :

You need to access the text field of that web view and pass value of your custom UItextfields and after that you can call webView's "Submit" button's Onclick event. 

```
NSString *javaScript = @"document.getElementById('id_username').value = 'tfusername'";
NSString *javaScript2 = @"document.getElementById('id_password').value = 'tfpassword'";

```

to evaluate each script you can call: `[webView stringByEvaluatingJavaScriptFromString:javaScript];`

You can also call script to press login button. This same thing work for me. May be this will help you.
I have created a wrapper for Instagram API for iOS. Take a look at this [link](https://github.com/kkocabiyik/KIngstagram) . This will also give an idea of what you need to do.