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

  • SEARCH
  • Home
  • 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 8735975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:11:48+00:00 2026-06-13T10:11:48+00:00

I am a newbie to iphone development and i am doing a simple app

  • 0

I am a newbie to iphone development and i am doing a simple app for practice. In that app,there is only one view that has an image on it. I want to be able to swipe left or right and have the first image go out of the view and the second image to come in. The images are different and I want it to look like they are connected. I need it to be able to change the image or restart after a series of swipes. I am doing this using ScrollView only.

I have tried something:

ViewController.h

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController <UIScrollViewDelegate>
{
    UIImageView *imgView;
    UIScrollView *scrollView;
}

@property (nonatomic,retain)IBOutlet UIImageView *imgView;
@property (nonatomic, retain) IBOutlet UIScrollView *scrollView;

//- (id)initWithPageNumber:(int)page;
- (IBAction)changePage:(id)sender;

@end

ViewController.m

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

@synthesize imgView,scrollView;

- (void)viewDidLoad
{
    [super viewDidLoad];

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
/*
- (id)initWithPageNumber:(int)page{
    if (self = [super initWithNibName:@"MyView" bundle:nil])
    {
        pageNumber = page;
    }
    return self;
}
*/



- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollview
{
    scrollView.contentOffset = CGPointMake(scrollview.bounds.size.width, 0);
}

- (IBAction)changePage:(id)sender
{

    NSArray *images = [[NSArray alloc] initWithObjects:@"1.jpeg",@"2.jpeg",@"3.jpeg", nil];
    scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:scrollView];
    CGRect cRect = scrollView.bounds;

    for (int i = 0; i < images.count; i++){
        imgView = [images objectAtIndex:i];
        imgView.frame = cRect;
        [scrollView addSubview:imgView];
        cRect.origin.x += cRect.size.width;
    }

    scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * images.count, scrollView.bounds.size.height);
    scrollView.contentOffset = CGPointMake(scrollView.bounds.size.width, 0);

}

@end

When i run the app, I am still not able to swipe across the images. Am i doing something wrong? Need some guidance on this. Thanks..

  • 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-06-13T10:11:50+00:00Added an answer on June 13, 2026 at 10:11 am

    This error indicates that you have a connection in Interface Builder with an IBOutlet that does not exist in your view controller class.

    Make sure your IBOutlets are named correctly and that you have removed all obsolete connections in IB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a newbie to iPhone app development. I want to make a simple
I am a newbie to iphone development and i am doing a simple app
i'm a newbie to iphone development. I'm doing a navigation-based app, and I'm having
I'm a newbie doing Objective-C, coming from Flex/Actionscript development. I have an iPhone app
I am a newbie in iPhone development, doing my first app. I have some
I'm a relative newbie on iPhone app development but have successfully created a tab
I am newbie to iPhone development. Is there any API or method to run
I'm a newbie in iPhone development and now encounter a problem: I want to
Please help a newbie to iPhone development. In my app, I do this a
I am a newbie in iphone development and want to implement coverflow. I googled

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.