Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 01-31-2010, 12:55 PM   #17 (permalink)
iPhoneDevelopment
Banned
 
Join Date: Dec 2009
Posts: 61
Default

The code I am now using:

Code:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
	
	UITouch *touch = [touches anyObject];
	startTouchPosition = [touch locationInView:self];
	
	character.animationImages = [NSArray arrayWithObjects:
								 [UIImage imageNamed:@"character.png"],
								 [UIImage imageNamed:@"character2.png"], nil];
	character.animationDuration = 0.5;
	character.animationRepeatCount = 1;
	[character startAnimating];
	[self.view addSubview:character];
}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
	
	UITouch *touch = [touches anyObject];
	CGPoint currentTouchPosition = [touch locationInView:self];
	
	if (currentTouchPosition.y > startTouchPosition.y) {
            [self characterJump:touches withEvent:event]; }
	
	CGPoint location = [touch locationInView:touch.view];
	CGPoint xLocation = CGPointMake(location.x,character.center.y);
	character.center = xLocation;
}

-(void) characterJump {
}
But Xcode tells me that I have not declared startTouchPosition, and that warning: incompatible Objective-C types 'JumpViewController*', expected 'UIView*' when passing argument 1 of 'locationInView:' from distinct Objective-C type??
Attached Images
File Type: jpg Screen shot 2010-01-31 at 17.50.00.jpg (20.7 KB, 0 views)

Last edited by iPhoneDevelopment; 01-31-2010 at 01:00 PM.
iPhoneDevelopment is offline   Reply With Quote
 

» Advertisements
» Online Users: 287
13 members and 274 guests
ADY, betterlee, BrianSlick, chits12345, dcool, JohnS., Joseph Nardone, leahov, marshusensei, Paul10, Phi, Promo Dispenser, RoryHarvey
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,219
Posts: 380,705
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:13 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.