Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7185901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:31:05+00:00 2026-05-28T18:31:05+00:00

New to iOS coding, so this is probably more of a syntax question than

  • 0

New to iOS coding, so this is probably more of a syntax question than anything else. I am trying to implement a UIImageView loaded with an array of image objects. On right swipe, I want to move to the next object in the array, and load it into the view. I have the array loaded fine, just don’t know how, syntactically, how to get the current position in the array. I realize this is a total n00b question, so free reputation cred for you.

Heres some code:

- (void)viewDidLoad
{
    [super viewDidLoad];  
    imageArray = [NSArray arrayWithObjects:[UIImage imageNamed:@"1.jpg"],[UIImage imageNamed:@"2.jpg"], nil];
    imageView.image = [imageArray objectAtIndex:0];

}

- (IBAction)swipeRightGesture:(id)sender {
 imageView.image = [imageArray somethingsomething];//load next object in array
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:31:06+00:00Added an answer on May 28, 2026 at 6:31 pm
    - (IBAction)swipeRightGesture:(id)sender 
    {
         NSUInteger index = [imageArray indexOfObject:imageView.image] + 1;
    
         // do something here to make sure it's not out of bounds
         //
    
         imageView.image = [imageArray objectAtIndex:index];//load next object in array
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, I am super-new to Objective-C/iOS development and, in fact, this question is for
New to iOS/Objective-C here. I've spent a lot of time trying to figure this
Very new to iOS coding. I'd like to be able to display a modal
I am new to iOS development. I am trying to figure out these things.
Currently I'm trying to access the files that are transferred using the new iOS
New to javascript/jquery and having a hard time with using this or $(this) to
New to Linux programming in general. I am trying to communicate with a kernel
new Date(05-MAY-09 03.55.50) is any thing wrong with this ? i am getting illegalArgumentException
New Question I am looking for a way in Javascript to get the parent
So I'm new to iOS development and am doing all I can to learn

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.