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 6234853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:33:56+00:00 2026-05-24T10:33:56+00:00

I am writing a program with a UIImageView. However, I am running into the

  • 0

I am writing a program with a UIImageView. However, I am running into the error: Exc_Arithmetic.

Here is my implementation:

#import "SalaatAppViewController.h"

@implementation SalaatAppViewController

@synthesize imageView;
@synthesize pauseButton;
@synthesize playButton;
@synthesize nextButton;

-(IBAction)pushPauseButton {
    [imageView stopAnimating];
}

-(IBAction)pushPlayButton {
    [imageView startAnimating];
}

- (IBAction)pushNextButton {

    imagesIndex = (imagesIndex + 1) % [images count];
    imageView.image = [images objectAtIndex:imagesIndex];

}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    imageView.animationImages = [[NSArray arrayWithObjects:
                                 [UIImage imageNamed:@"1.png"],
                                 [UIImage imageNamed:@"2.png"],
                                 [UIImage imageNamed:@"3.png"],
                                  nil] retain];
    UIImage *image = [UIImage imageNamed: @"2.png"];
    [imageView setImage:image];
    imageView.animationDuration = 1.00;
    imageView.animationRepeatCount = 0;
    [imageView startAnimating];
    imagesIndex = 0;
    imageView.image = [images objectAtIndex:imagesIndex];
    [super viewDidLoad];
    [self.view addSubview:imageView];

}


- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(void) dealloc {
    [imageView release];
    [pauseButton release];
    [playButton release];
    [nextButton release];
    [super dealloc];

}

@end

My Header:

#import <UIKit/UIKit.h>

@interface SalaatAppViewController : UIViewController {
    UIImageView *imageView;
    UIButton *pauseButton;
    UIButton *playButton;
    UIButton *nextButton;
    NSUInteger images;
    NSUInteger imagesIndex;
}

@property (nonatomic, retain) IBOutlet UIImageView *imageView;
@property (nonatomic, retain) IBOutlet UIButton *pauseButton;
@property (nonatomic, retain) IBOutlet UIButton *playButton;
@property (nonatomic, retain) IBOutlet UIButton *nextButton;


-(IBAction)pushPauseButton;
-(IBAction)pushPlayButton;
-(IBAction)pushNextButton;

@end

The program runs, but with 9 warnings and 1 error. Also, when I push the Next Button, it crashes. Please Help!

  • 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-24T10:33:57+00:00Added an answer on May 24, 2026 at 10:33 am

    Ahmad your “images” property should be not NSUInteger but NSArray*. Define it in a following way:

    NSArray *images;
    

    It seems you replaced too much by following my previous guidance. =)

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

Sidebar

Related Questions

I am writing a program which has two panes (via CSplitter ), however I
I am writing a program to add to and update an address book. Here
I am writing a program in C++ which uses the CLAPACK ATLAS library. However,
Im writing a program that should read input via stdin, so I have the
I'm writing a program that sends an email out at a client's specific local
If you are writing a program that is executable from the command line, you
I'm writing a program (for Mac OS X, using Objective-C) and I need to
I'm writing a program to read from a POP3 mailbox and upload the email
I'm writing a program that uses SetWindowRgn to make transparent holes in a window
I am writing a program in Python that will act as a server and

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.