Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

reziasultana

macrumors newbie
Original poster
Apr 4, 2012
2
0
Hi

Please can someone help. I am a beginner and can't work out what the problem is with my file. Below is my m file. I have added in the error messages in red.

//
// ImageHopViewController.m
// ImageHop
//
// Created by Guest one on 25/05/2012.
// Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import "ImageHopViewController.h"

@implementation ImageHopViewController

@synthesize toggleButton;
@synthesize imageView;
@synthesize animationSpeed;
@synthesize hopsPerSecond;

-(IBAction) setSpeed:(id)sender {
NSString *hopRateString;
imageView.animationDuration=2-animationSpeed.value;
[imageView startAnimating];
[toggleButton setTitle:mad:"Sit Still!"
forState:UIControlStateNormal];
hopRateString=[[NSString alloc]
initWithFormat:mad:"%1.2f hps",1/(2-animationSpeed.value)];
hopsPerSecond.text=hopRateString;
[hopRateString release];

}


-(IBAction) toggleAnimation:(id)sender {
if (imageView.isAnimating) {
[imageView stopAnimating];
[toggleButton setTitle:mad:"Hop!" forState:UIControlStateNormal];
} else {
[imageView startAnimating];
[toggleButton setTitle:mad:"Sit Still!" forState:UIControlStateNormal];
}


/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad { undeclared (first use in function and expected ';' before '{' token
NSArray *hopAnimation;
hopAnimation=[[NSArray alloc] initWithObjects:
[UIImage imageNamed:mad:"frame-1.png"],
[UIImage imageNamed:mad:"frame-2.png"],
[UIImage imageNamed:mad:"frame-3.png"],
[UIImage imageNamed:mad:"frame-4.png"],
[UIImage imageNamed:mad:"frame-5.png"],
[UIImage imageNamed:mad:"frame-6.png"],
[UIImage imageNamed:mad:"frame-7.png"],
[UIImage imageNamed:mad:"frame-8.png"],
[UIImage imageNamed:mad:"frame-9.png"],
[UIImage imageNamed:mad:"frame-10.png"],
[UIImage imageNamed:mad:"frame-11.png"],
[UIImage imageNamed:mad:"frame-12.png"],
[UIImage imageNamed:mad:"frame-13.png"],
[UIImage imageNamed:mad:"frame-14.png"],
[UIImage imageNamed:mad:"frame-15.png"],
[UIImage imageNamed:mad:"frame-16.png"],
[UIImage imageNamed:mad:"frame-17.png"],
[UIImage imageNamed:mad:"frame-18.png"],
[UIImage imageNamed:mad:"frame-19.png"],
[UIImage imageNamed:mad:"frame-20.png"],
nil
];
imageView.animationImages=hopAnimation;
imageView.animationDuration=1;
[hopAnimation release];
[super viewDidLoad];
}



/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (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.
}

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


- (void)dealloc {
[toggleButton release];
[imageView release];
[hopsPerSecond release];
[animationSpeed release];
[super dealloc];
}


@end expected declaration or statement at the end of input
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.