Search Results

Search found 393 results on 16 pages for 'uiscrollview'.

Page 7/16 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Swiping Images with Page Control in Iphone

    - by lakesh
    I am trying to make practice app where i can scroll images with page control. I am able to scroll images and able to include the page control. But the problem i face is i am not able to interlink the two. Meaning to say when I scroll the images, the page control is not affected and when i change the page control, the scrolling of the images is unaffected. I have referred to this: http://www.iosdevnotes.com/2011/03/uiscrollview-paging/ for the scrolling with page control. Viewcontroller.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController <UIScrollViewDelegate>{ UIScrollView *scrollView; UIPageControl *pageControl; BOOL pageControlBeingUsed; } @property (nonatomic, retain) IBOutlet UIScrollView *scrollView; @property (nonatomic, retain) IBOutlet UIPageControl *pageControl; - (IBAction)changePage; @end Viewcontroller.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize scrollView,pageControl; - (void)viewDidLoad { [super viewDidLoad]; NSArray *images = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"1.jpeg"],[UIImage imageNamed:@"2.jpeg"],[UIImage imageNamed:@"3.jpeg" ], nil]; self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width * images.count, self.scrollView.frame.size.height); for (int i = 0; i < images.count; i++) { CGRect frame; frame.origin.x = self.scrollView.frame.size.width * i; frame.origin.y = 0; frame.size = self.scrollView.frame.size; UIImageView* imgView = [[UIImageView alloc] init]; imgView.image = [images objectAtIndex:i]; imgView.frame = frame; [scrollView addSubview:imgView]; } } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; self.scrollView = nil; } - (void)scrollViewDidScroll:(UIScrollView *)sender { // Update the page when more than 50% of the previous/next page is visible CGFloat pageWidth = self.scrollView.frame.size.width; int page = floor((self.scrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1; self.pageControl.currentPage = page; } - (IBAction)changePage{ // update the scroll view to the appropriate page CGRect frame; frame.origin.x = self.scrollView.frame.size.width * self.pageControl.currentPage; frame.origin.y = 0; frame.size = self.scrollView.frame.size; [self.scrollView scrollRectToVisible:frame animated:YES]; pageControlBeingUsed = YES; } - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { pageControlBeingUsed = NO; } - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { pageControlBeingUsed = NO; } @end Need some guidance on this... Thanks..

    Read the article

  • How to get a UIScrollView embedded within a UITableCellView to scroll?

    - by Zan
    I have a scroll view containing several images embedded within a custom cell view, it sometimes scrolls horizontally if I keep holding the cell for a while. I tried a lot of things and it doesn't seem to work, please help? Here's part of the CustomCell : UITableViewCell code: -(void) layoutSubviews { CGRect scrollViewFrame = CGRectMake(0, 0, 320, 200); self.scrollView.frame = scrollViewFrame; self.scrollView.backgroundColor = [UIColor whiteColor]; self.scrollView.contentSize = CGSizeMake((320*3), 200); self.scrollView.scrollEnabled = YES; self.scrollView.clipsToBounds = YES; self.scrollView.pagingEnabled = YES; self.scrollView.showsHorizontalScrollIndicator = NO; self.scrollView.showsVerticalScrollIndicator = NO; self.scrollView.scrollsToTop = NO; self.scrollView.delegate = self; self.scrollView.userInteractionEnabled = YES; // add 3 images to subview here pageControl.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.7]; pageControl.frame = CGRectMake(0, 170, 320, 30); pageControl.numberOfPages = 8;} I tested the code on a UIViewController and it works just fine, I'm guessing that this is caused by cell selection and I tried returning nil when the cell gets selected and that didn't work. I also tried passing touches to the scrollview and that didn't work either, please help?

    Read the article

  • UIScrollView map with pins that stay at a fixed size?

    - by OMH
    Hi, In my app, I have a ScrollView that shows a map(just a jpeg). On top of the ScrollView, I added some pins(UIImageView) So far so good. But when I zoom in, the pins also get larger. I would like the pins to stay at a fixed size, just like the pins on the google map application on the iPhone. How do I solve this? Thanks!

    Read the article

  • UIScrollView - with paging enabled, can I "change" the page width?

    - by Mike McMaster
    What's the simplest way to have a scroll view (with pagingEnabled set to YES) have a page width set to something other than the scroll view's bounds? Let me give an example. Suppose I have a scroll view with 10 items, each 150 pixels wide, and my scroll view is 300 pixels wide. If I start with views 1 and 2 visible and scroll horizontally to the right, I want the next "page" to show items 2 and 3. If I scroll one more page to the right, I would see items 3 and 4. Has anyone done this? If not, what strategy would you use?

    Read the article

  • Add double tap action (presentModalViewController) to UISCOLLVIEW

    - by R.J.
    I have been wrestling this issue for a while now and cannot seem to get the following "touchesEnded" method to execute within a UISCROLLVIEW. I have read on many of the forums that UISCROLLVIEW will take control of all touch events unless it is subclassed, but I cannot seem to get the code right (still new to the SDK). Basically I have a scrollview made uo with several UIIMAGEVIEW's and currenlty have scrolling with paging (much like the photo app). I have been studying the SCROLLING MADDNESS example without success. All I want to do is anywhere in the UISCROLLVIEW have the user double tap to presentModalViewController back to my info page (i.e.) (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSSet *allTouches = [event allTouches]; switch ([allTouches count]) { case 1: {// One finger touch UITouch *touch = [[allTouches allObjects] objectAtIndex:0]; if ([touch tapCount] == 2) {InfoButtonViewController *scroll = [[InfoButtonViewController alloc] initWithNibName:nil bundle:nil]; scroll.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:scroll animated:YES]; [scroll release]; } } } } Any code assistance would be greatly appreciated. The UISCROLLVIEW is implemented as follows (let me know if I need to provide additional details). Thank you in advance... MyViewController.h @interface MyViewController : UIViewController { } @end

    Read the article

  • Resizing Tab Bar Controller Views (iPhone dev)

    - by damiandawber
    Hello, I have an application set up where the window contains a tab bar controller and one of the tabs loads a NIB called 'ShowCaseView.xib': this file is owned by a custom ShowcaseViewController class. In the ShowcaseViewcontroller class I have added a UIScrollView object, like so: imageScrollView = [[UIScrollView alloc] initWithFrame:[[self view] bounds]]; [[self view] addSubview:imageScrollView]; The issue I am having is that this UIScrollView object extends beneath my tab bar controller. So I have had to reduce its insets manually: #define TAB_BAR_HEIGHT 48 . . UIEdgeInsets edgeInsets = UIEdgeInsetsMake(0, 0, TAB_BAR_HEIGHT, 0); [imageScrollView setScrollIndicatorInsets:edgeInsets]; So, Is it common to have to manually deduct the tab bar height from a view (whether this be by reducing the size of subviews or the View NIB in inspector)? Is there a way that I can tell a NIB's view loaded from a tab bar to resize itself automatically to NOT sit behind the tab bar? Cheers

    Read the article

  • how to programatically set the current page for UIPageControl?

    - by RexOnRoids
    I have 3 "pages" (page 0, page 1, page 2) in a UIScrollView that are snapped to by finger swipes. There is a UIPageControl there too. The UIScrollView starts off presenting page 0. What I want to do is present page 3 FIRST sometimes. How can I do this programatically. Simply setting currentPage (of UIPageControl) to the page number does nothing by the way.

    Read the article

  • how to "crop" a uiimage ?

    - by Yoot
    Hi, I'm making an app in which the user chooses an image, resize it by zooming (in a uiscrollview) and move it in the view. When finished, I would like to save the image like we can see it in the uiscrollview. Do you have any idea ? Thanks.

    Read the article

  • viewWillAppear for subviews

    - by nan
    I have UIScrollView with multiple UIVIew subviews. I would like to update the data that is displayed by each UIView when they appear in the visible portion of the UIScrollView. What is the callback that gets triggered? I tried viewWillAppear, but it does not seem to get called. Thanks. :)

    Read the article

  • Forwarding first responder to UIScrollView unsuccessful

    - by Winston
    Hello, I am trying to create an image cropping bpx whereby the underlying image can be zoomed an scrolled while the cropping "maskview" layer stays the same and the corners can be dragged in any direction. To achieve this, the ImageView is added to a UIScrollView, and this is added to the SelectionViewController.view . I then add the cropping "maskview" layer to the SelectionViewController.view. I did this instead of adding to the scrollview so that the cropping maskview won't be expanded when the underlying image expands. @interface SelectionViewController : UIViewController <UIScrollViewDelegate> { UIImageView *photoview; // Added to self.scrollview MaskedView *maskedview; // Added to self.view UIScrollView *scrollview; // Added to self.view } The maskview has first responder status and responds accordingly. However, the only event I am interested in the maskview is if any of the corners are dragged (this works fine). The problem I want to try to solve is two-fold: If it is a pinch or zoom gesture, I am trying to forward the responder to the UIScrollview using: [self.nextResponder touchesMoved:touches withEvent:event]; The scrollview does not seem to respond. I have confirmed that the self.nextResponder after the maskedview is the SelectionViewController's view itself. From there, it doesn't seem like the UIScrollview responds. It does respond fine if I remove the cropping maskedview. If I zoom in on the underlying image and the cropping maskview rectangle is still the same, I want to now crop the actual zoomed image. Let's say for the upper left hand corner of the crop box, how can I find what the coordinates translates to in the underlying UIImageView now that the image has been zoomed? Any insight into either of these questions would be appreciated. Thank you, Winston

    Read the article

  • UIPageControl bug: showing one bullet first and then showing everything

    - by user313551
    I have some strange behavior using a UIPageControl: First it appears showing only one bullet, then when I move the scroll view all the bullets appear correctly. Is there something I'm missing before I add it as a subview? Here is my code imageScrollView.h : @interface ImageScrollView : UIView <UIScrollViewDelegate> { NSMutableDictionary *photos; BOOL *pageControlIsChangingPage; UIPageControl *pageControl; } @property (nonatomic, copy) NSMutableDictionary *photos; @property (nonatomic, copy) UIPageControl *pageControl; @end Here is the code for imageScrollView.m: #import "ImageScrollView.h" @implementation ImageScrollView @synthesize photos, pageControl; - (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { // Initialization code NSLog(@"%@",pageControl); } return self; } - (void) drawRect:(CGRect)rect { [self removeAllSubviews]; UIScrollView *scroller = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,self.frame.size.width,self.frame.size.height)]; [scroller setDelegate:self]; [scroller setBackgroundColor:[UIColor grayColor]]; [scroller setShowsHorizontalScrollIndicator:NO]; [scroller setPagingEnabled:YES]; NSUInteger nimages = 0; CGFloat cx= 0; for (NSDictionary *myDictionaryObject in photos) { if (![myDictionaryObject isKindOfClass:[NSNull class]]) { NSString *photo =[NSString stringWithFormat:@"http://www.techbase.com.mx/blog/%@", [myDictionaryObject objectForKey:@"filepath"]]; NSDictionary *data = [myDictionaryObject objectForKey:@"data"]; UIView *imageContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - 30)]; TTImageView *imageView = [[TTImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - 30)]; imageView.urlPath=photo; [imageContainer addSubview:imageView]; UILabel *caption = [[UILabel alloc] initWithFrame:CGRectMake(0,imageView.frame.size.height,imageView.frame.size.width,10)]; [caption setText:[NSString stringWithFormat:@"%@",[data objectForKey:@"description"]]]; [caption setBackgroundColor:[UIColor grayColor]]; [caption setTextColor:[UIColor whiteColor]]; [caption setLineBreakMode:UILineBreakModeWordWrap]; [caption setNumberOfLines:0]; [caption sizeToFit]; [caption setFont:[UIFont fontWithName:@"Georgia" size:10.0]]; [imageContainer addSubview:caption]; CGRect rect = imageContainer.frame; rect.size.height = imageContainer.size.height; rect.size.width = imageContainer.size.width; rect.origin.x = ((scroller.frame.size.width - scroller.size.width) / 2) + cx; rect.origin.y = ((scroller.frame.size.height - scroller.size.height) / 2); imageContainer.frame=rect; [scroller addSubview:imageContainer]; [imageView release]; [imageContainer release]; [caption release]; nimages++; cx +=scroller.frame.size.width; } } [scroller setContentSize:CGSizeMake(nimages * self.frame.size.width, self.frame.size.height)]; [self addSubview:scroller]; pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(self.frame.size.width/2, self.frame.size.height -20, (self.frame.size.width/nimages)/2, 20)]; pageControl.numberOfPages=nimages; [self addSubview:pageControl]; [scroller release]; } -(void)dealloc { [pageControl release]; [super dealloc]; } -(void)scrollViewDidScroll:(UIScrollView *)_scrollView{ if(pageControlIsChangingPage){ return; } CGFloat pageWidth = _scrollView.frame.size.width; int page = floor((_scrollView.contentOffset.x - pageWidth /2) / pageWidth) + 1; pageControl.currentPage = page; } -(void)scrollViewDidEndDecelerating:(UIScrollView *)_scrollView{ pageControlIsChangingPage = NO; } @end

    Read the article

  • Removing views from UIScrollView

    - by mohan
    I have two UIScrollViews that I move images between. The user can drag and forth between the scroll views. I am trying to animate the movement of the image from one scroll view to another. In -touchesMoved (handled in my UIViewController which has two custom UIScrollViews that intercept touch and sends to my UIViewController), I am trying to set the "center" of my UIImageView that is being moved. As it is moved, the image gets hidden behind the UIScrollView and not visible. How do I make it appear on top of the UIScrollView? I am able to handle the -touchesEnded properly by animating in the destination scroll view. I am also confused about -convertPoint:fromView: usage in the iPhone Programming Guide (See Chapter 3, Event Handling). If the touch coordinates are in window coordinates, to change my view (UIImageView inside a UIScrollView which is inside a UIView and inside a window) center don't I have to use -convertPoint:toView:, i.e., imageView.center = [self.view.window convertPoint:currentTouchPosition toView:imageView]; What am I missing?

    Read the article

  • Intercept UITableView scroll touches

    - by Jonesy
    Is it possible to control when the UITableView scrolls in my own code. I am trying to get behaviour where a vertical swipe scrolls and a horizontal swipe gets passed through to my code (of which there are many example) BUT I want a DIAGONAL swipe to do nothing, i.e the UITableView should not even begin scrolling. I tried catching it in here - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView but the scrollView.contentOffset.x is always 0 so I cannot detect a horizontal movement. I also tried subclassing UITableView and implementing - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event etc.. but the UITableView (and I guess it's parent UIScrollView) start to scroll before the touches are notified? To re-iterate, I want the UITableView scrolling to be locked if a diagonal swipe is made, but to scroll vertically normally. (This behaviour can be seen in Tweetie(Twitter) for the iPhone) Thanks for any help!

    Read the article

  • contentoffset during flick gesture

    - by Michael Xu
    Hi all, Does anyone else notice that the contentOffset of UIScrollView doesnt update during a flick gesture? It only updates after the flick gesture has totally completed, when the flick gesture is finished. After the finger has left the screen, the scrollview keeps moving, in the decelerating phase. but this isnt reflected in the contentOffset of the UIScrollView. Is there a way to track where the contentOffset is during the decelerating part of the flick gesture? I have an OpenGL layer on top, and i want it to move with the scrollView. Can't seem to get the right info out of the scrollview though... Thoughts? thanks, michael

    Read the article

  • iPhone image app not releasing memory as in instruments using imageNamed

    - by Tankista
    hi, im building iPhone app that downloads images (UIImageView) from internet and adding them to UIScrollView. This scroll view could contain 20 or more UIImageViews. Iam adding UIImages to UIImageView like this: UIImageView *newView = [[UIImageView alloc] initWithImage: image]; Then I just scroll these images like in photo app. Problem is, when I put just 3 UIImageViews in UIScrollView everything works fine, but when I put more images, more memory is used, so that app can crash after 15 or more images. I can understand it that more images alloc more memory, but in Instruments i get allocated max 2-3 MB, but in device memory raises until it crashes. When I use simulator for OS 3.0 i can see memory rising like on device. On higher versions I dont see this memory raise, why is that?

    Read the article

  • iPhone: scroll view with arbitrary page/"settling" boundaries?

    - by Ben
    Hi all, I'm trying to figure out if I can get what I want out of UIScrollView through some trickery or whether I need to roll my own scroll view: I have a series of items in row that I want to scroll through. One item should always be centered in the view, but other items should be visible to either side. In other words, I want normal scrolling and edge bouncing, but I want the deceleration when the user ends a touch to naturally settle at some specified stop point. (Actually now that I think of it, this behavior is similar to coverflow in this respect.) I know UIScrollView doesn't do this out of the box, but does anyone have suggestions for how it might be made to do this, or if anyone's spotted any code that accomplishes something similar (I'm loathe to reimplement all the math for deceleration and edge bounce) Thanks!

    Read the article

  • Zooming to UIView and it's sub-views

    - by leon
    Hi, I have a UIView which I can zoom to (as it is set as a subview of UIScrollView). UIView has UILabel, UITextField, etc. If I just zoom to the UIView, then of course label and text field get fuzzy (the same effect if you are zooming to the image file without changing image resolution). To solve the problem I need to increase the font size and sizes of the UILable and UITextField in according to the scale used to zoom in (scale is passed as a param by the UIScrollView). This is where I am getting confused. Changing frame (by increasing it width and height by zooming scale) I get all my elements (sub-views) repositions (because changing frame effects center and bounds) Question: 1. What would I need to do to zoom in to the sub-views and just increase the sub-view sizes while keeping them in the exactly the same position? thanks

    Read the article

  • UISwitch within UIScrollview nearly impossible to use....

    - by samsam
    Hi there. I'm using a UISwitch-Component at the bottom of a view that sits within a UIScrollView. Now the problem that appeared, is that the switch is nearly impossible to swipe because the UIScrollView seems to dominate the userinput. Switching works very well by tapping the switch, but from my point of view, most users "switch" the UISwitch instead of tapping. Did anyone of you face the same / or similar problems and managed to come up with a solution? thx in advance sam

    Read the article

  • How can I pass a UIEvent to a UIScrollView

    - by rickharrison
    I am subclassing UIWindow and creating an implementation of sendEvent: as follows: - (void)sendEvent:(UIEvent *)event { [super sendEvent:event]; // Send event to UIScrollView here } How can I send the event to a UIScrollView. I tried calling the touchesBegan:, etc. messages, but that did not do anything.

    Read the article

  • How to use drag and drop within a UIScrollView

    - by user249488
    I am trying to drag and drop UIViews within a UIScrollView. I'd like the UIScrollView to scroll if I drag a UIView so that it intersects the top or bottom of the ScrollView. If it touches the top, it should scroll up. If it touches the bottom, it should scroll down. Once the UIView is moved such that it is no longer intersecting the top or bottom, the scrolling should stop. The first approach I tried was to start an NSTimer whenever I detected that the UIView intersected with the top or bottom of the scrollview. The timer would scroll the UIScrollView bit by bit until it was invalidated. This resulted in very jerky scrolling, since there is no way to predict when the timers will fire. My current approach is to simply scroll all the way to the top or bottom of the ScrollView, like this: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:1.0]; [self.parentScrollview setContentOffset:newOffset animated:NO]; [UIView commitAnimations]; In order to stop scrolling, I try to determine the position of the touch in the touchesMoved: delegate, and use that to calculate the contentOffset to use for the scrollView. The problem is, when I try to get the location in the view via [[touches anyObject] locationInView:self], I get the final end location, rather than the current location. I'm guessing that's because the contentOffset on the scrollView is set immediately. Is there a way to get the actual location of a touch in a situation like this? Or any other way to set the contentOffset when I interrupt the scrolling animation?

    Read the article

  • EXC_BAD_ACCESS on button press for button dynamically added to UIView within UIScrollView

    - by alan
    OK. It's an iPad app. Within the DetailViewController I have added a UIScrollView through IB and within that UIScrollView I have added a UIView (also added through IB) which holds various dynamically added UITableViews, UILabels and UIButtons. My problem is that I'm getting errors on the UIButton clicks. I have defined this method: - (void)translationSearch:(id)sender { NSLog(@"in transearch"); [self doSearch]; } This is how I'm adding the UIButton to the UIView: UIButton *translationButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; translationButton.frame = CGRectMake(6, 200, 200, 20); translationButton.backgroundColor = [UIColor clearColor]; [translationButton setTitle:@"testing" forState:UIControlStateNormal]; [translationButton addTarget:self action:@selector(translationSearch:) forControlEvents:UIControlEventTouchUpInside]; [verbView addSubview:translationButton]; Now the button is added to the form without any issue but, when I press it, I am getting an EXC_BAD_ACCESS error. I'm sure it's staring me in the face but I've passed my usual time limit for getting a bug like this fixed so any help would be greatly appreciated. The only thing I can think is the fact that the UIButton is within a UIView which is within a UIScrollView which is within the view controller is somehow causing an issue. Cheers.

    Read the article

  • ScrollView content async downloading problem

    - by Newbee
    Hi! I have UIScrollView with lots of UIImageView inside. In the loadView method I assign some temporary image for each of subview UIImageView images and starts several threads to async download images from internet. Each thread downloads and assign images as follows: NSData *data = [NSData dataWithContentsOfURL:URL]; UIImage *img = [UIImage imageWithData:data]; img_view.image = img; Here is the problem - I expects picture will changed after each image downloaded by I can see only temporary images until all images will downloads. UIScrollView still interact while images downloads - I can scroll temporary images inside it and see scrollers and nothing blocks run loop, but downloaded images doesn't updates.. What I tried to do: Call sleep() in the download thread -- not helps. Call setNeedsDisplay for each ImageView inside ScrollView and for ScrollView -- not helps. What's wrong ? Thanks. Update. I tried some experiments with number of threads and number of images to download. Now I'm sure -- images redraws only when thread finished. For example - if I load 100 images with one thread -- picture updates one time after all images downloads. If I increase number of threads to 10 -- picture updates 10 times -- 10 images appears per update. One more update. I fixed problem by staring new thread from the downloading threads each time one image downloaded and exit current thread (instead of download several images in one thread in the cycle and exit thread only when all downloaded). Obviously it's not a good solution and there must be right approach.

    Read the article

  • performSelector:withObject:afterDelay: not working from scrollViewDidZoom

    - by oldbeamer
    Hi all, I feel like I should know this but I've been stumped for hours now and I've run out of ideas. The theory is simple, the user manipulates the zoom and positioning in a scrollview using a pinch. If they hold that pinch for a short period of time then the scrollview records the zoom level and content offsets. So I thought I'd start a performSelector:withObject:withDelay on the scrollViewDidZoom delegate method. If it expires then I record the settings. I delete the scheduled call every time scrollViewDidZoom is called and when the pinch gesture finishes. This is what I have: - (void)scrollViewDidZoom:(UIScrollView *)scrollView{ NSLog(@"resetting timer"); [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(positionLock) object:nil]; [self performSelector:@selector(positionLock) withObject:nil afterDelay:0.4]; } -(void)positionLock{ NSLog(@"position locked "); } - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale{ NSLog(@"deleting timer"); [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(positionLock) object:nil]; } This is the output: 2010-05-19 22:43:01.931 resetting timer 2010-05-19 22:43:01.964 resetting timer 2010-05-19 22:43:02.231 resetting timer 2010-05-19 22:43:02.253 resetting timer 2010-05-19 22:43:02.269 resetting timer 2010-05-19 22:43:02.298 resetting timer 2010-05-19 22:43:05.399 deleting timer As you can see the delay between the last and second last events should have been more than enough for the delayed selector call to execute. If I replace performSelector:withObject:withDelay with plain old performSelector: I get this: 2010-05-19 23:08:30.333 resetting timer 2010-05-19 23:08:30.333 position locked 2010-05-19 23:08:30.366 resetting timer 2010-05-19 23:08:30.367 position locked 2010-05-19 23:08:30.688 deleting timer Which isn't what I want but serves to show that it's only the delay that's causing it to not function, not something to do with the selector not being declared in the header, being misspelt or any other reason. Any ideas as to why it's not working?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >