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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-15-2009, 05:19 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Montreal, QC
Posts: 16
Question knowing when UIScrollView has moved

Hello,

i'm having trouble trying to find out when my scroll view has been moved by the user (by moved i mean has been dragged to the next view)

I found code online that seems to work for everyone ans i was wondering if perhaps i'm doing something wrong and are just not noticing it

In my .h i have
Code:
@interface PhotoViewController : UIViewController <UIScrollViewDelegate>{

	IBOutlet	UIScrollView	*scrollView;
....
}

@property	(nonatomic, retain)	UIScrollView	*scrollView;
...
When I start my viewController I create ImageViews to hold my images and load them

Code:
 (void)viewDidLoad {
  [super viewDidLoad];
	
	for (int i = 0; i < self.photoCount; i++){
		UIImage	*image;
		UIImageView *imageView;
		image = [UIImage imageNamed:@"placeholder.png"];
		imageView = [[UIImageView alloc] initWithImage:image];
		newWidth = 200.0;
		newHeight = 200.0;

		CGRect rect = imageView.frame;
		rect.size.height = newHeight;
		rect.size.width = newWidth;
		imageView.frame = rect;
		imageView.tag = i;	
		[scrollView addSubview:imageView];
		[imageView release];
	}

	[self layoutScrollImages]; //center images in scroll view
}
and while searsching i found the follwoing which does nothing when i drag to switch image

Code:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
	NSLog(@"3333");	
}

- (void)scrollViewDidEndScrollingAnimation: (UIScrollView *)scrollView {
	NSLog(@"1111");	
}
-(void)scrollViewDidScroll:(UIScrollView *)sender {
	NSLog(@"2222");
}
Nothing is being logged...

can anybody please help!!
thanks
simply07 is offline   Reply With Quote
Old 12-15-2009, 05:57 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,129
Default

Did you set the delegate for the scroll view?
__________________
BriTer Ideas LLC - Code review, consulting, development. PM for pricing.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
BrianSlick is offline   Reply With Quote
Old 12-16-2009, 12:39 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Montreal, QC
Posts: 16
Talking WOOT!!!

Indeed...

i had it set in my .h but it wasn't set in the interface builder...

Thanks for the help!!!
simply07 is offline   Reply With Quote
Reply

Bookmarks

Tags
scrollviewdidscroll, uiscrollview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 244
17 members and 227 guests
ADY, Alsahir, Dani77, Desert Diva, Duncan C, F_Bryant, Grinarn, HemiMG, Herbie, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,761
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:43 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0