i have made a mistake of re-inventing the wheel. There are options 
but somehow i like the feel of this.
Sorry but don't have enough rep to post an image.
This is how the form looks like:

SNO.-------ITEMS--------FROM--------TO---------QUANTITY // labels

[ 1 ]-------[-----------▼]---[--------]----[--------]------[-------------] {NEW} {DELETE} //textboxes and buttons 

I've got the 'new' button click event to generate a row, and serial number to be automatic
and inserted the items into the collections from Properties panel.
Delete button deletes an entire row and shifts both the button up on Y position.

I need to assign the value of quantity [(TO - FROM ) + 1] in the QUANTITY text boxes, 
for which i have the code as :

```
    public void print_quant(object Sender, EventArgs e)
    {
        TextBox quanty;
        quanty = (TextBox)this.Controls.Find("QUANTITY" + (count), true)[0];
        calculate_quant(this, e);
        quanty = result;

    }
    public static string result;
    public string calculate_quant(object sender, EventArgs e)
    {
        TextBox sfrom;
        sfrom = (TextBox)this.Controls.Find("SFRM" + count, true)[0];

        TextBox sto;
        sto = (TextBox)this.Controls.Find("STO" + count, true)[0];

        TextBox quan;
        quan = (TextBox)this.Controls.Find("QUANTITY" + count, true)[0];

            //if (!string.IsNullOrEmpty(sfrom.Text) && !string.IsNullOrEmpty(sto.Text))
          {
              int to = Convert.ToInt32(sto.Text);
              int from = Convert.ToInt32(sfrom.Text);
              int quantity = (to - from) + 1;
              result = quantity.ToString();   
              quan.Text = result;
          }
         return result;             
    }

```

count is initialized at 1 on form load, keeps increasing with number of rows

the same code works in the delete row method 

```
    public void delete_row(object sender, EventArgs e) //function to delete a row
    {
        TextBox snum;
        snum = (TextBox)this.Controls.Find("SNO"+count, true)[0];
        snum.Dispose();
...//delete other row elements
}

```

please help me figure out why it doesnt work for the print\_quant / calculate\_quant methods
['https://Stackoverflow.com/questions/21280535', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2437356/']
You can't do this because it isn't ready yet. 

```
cvc.desktopview.image = image;

```

Instead you need to store it in a `UIImage` property and use it in `viewDidLoad` method of your destination view controller.

Something like this in `prepareForSegue`

```
cvc.image = image;

```

and in the view controller

```
- (void)viewDidLoad
{
    [super viewDidLoad];

    self.desktopview.image = image;

}

```

Edit:

You need this at your view controller's header file.

```
@property (nonatomic, strong) UIImage * image;

```
Optimized way 

```
 [segue.destinationViewController setAnotherImage:yourImage];

```

Another view controller 

```
-(void)setAnotherImage:(UIImage *)happiness
{
    //get your image here
}

```