UIImageView problem

Discussion in 'iOS Programming' started by flashyx, Mar 1, 2013.

  1. flashyx macrumors newbie

    Mar 1, 2013
    hi guys,

    super new here,

    been googling for hours, cant work it out and need a hand.

    i have set up a UIImageView and one Round Rect Button onto my storyboard.

    i have a png image i have draged into the root of my project.

    im trying to get it that when you press a button image1.png will load into the UIImageView.

    how the heck do i do it?

    a step by step would be fantastic.

    thanks guys.
  2. Sonnestah, Mar 2, 2013
    Last edited by a moderator: Mar 2, 2013

    Sonnestah macrumors regular

    Mar 2, 2013
    link both to your header file, button as ibaction, uiimageview as outlet

    switch to your implementation file, find the method for your button and write the following:

    self.youruiimageview.image = [UIImage imageNamed:@"image1.png"];

Share This Page