[iPhone] UIScrollView responder chain problems

I have a view hierarchy something with a UIImageView as a subview of a UIScrollView as a subview of my view controller's view.
According to the documentation, the each object in the responder chain is supposed to pass a touch event to it's view controller (if it has one, and then onto it's superview). So, if I tap the uiimage, the touch event should eventually get passed up to the top level view controller where I can handle it.
Well, it's not working....the event never reaches the top level. Only touches on direct subviews of the top view are received by the controller.
Does this work for anyone else, with a similar hierarchy ? Are there any good techniques or tools for debugging the responder chain ?

Hello -
I faced a similar issue.
I used the following to force my UIView to report to its parent UIScrollView:
[self.nextResponder.nextResponder touchesBegan:touches withEvent:event];
I am not exactly sure why but I had to jump one "nextResponder" to go directly to the one above.
This is all quite obscure to me; but somehow it seems to work....
BTW, it is possible to check "who is who" using:
NSLog(@"%s",[self.nextResponder.description cStringWithEncoding:1]);
(self-made probably-quite-primitive trick...)
Hope that helps.
S

Similar Messages

  • (iPhone SDK 7) UIScrollView subview touch problem

    New here, in fact new to the SDK but getting on well with it (plenty of previous coding experience to draw on). However, I've been hitting my head against a brick wall with UIScrollView and it making subviews, e.g. UIImageViews, no longer be touchable. When I move the image views outside the scroll view it's fine, so I know they're working and the touchesBegan:withEvent is processing as it should do.
    Here's what I'm doing in the initWithFrame:
    scroller = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,320,400)];
    scroller.scrollEnabled = YES;
    CGSize sz;
    sz.width = 320;
    sz.height = 800;
    scroller.contentSize = sz;
    scroller.tag = 400;
    scroller.userInteractionEnabled = YES;
    scroller.delaysContentTouches = YES;
    scroller.canCancelContentTouches = NO;
    [self addSubview:scroller];
    (I've tried all different combinations of delaysContentTouches and canCancelContentTouches just to see if they made a difference, originally I hadn't got either in there. But they don't seem to alter anything)
    And then the image views:
    buttonPlay = [[UIImageView alloc] initWithFrame:CGRectMake(20,320,40,40)];
    buttonPlay.image = [UIImage imageNamed:@"blah.jpg"];
    buttonPlay.userInteractionEnabled = YES;
    buttonPlay.tag = 100;
    [scroller addSubview:buttonPlay];
    buttonSettings = [[UIImageView alloc] initWithFrame:CGRectMake(80,320,40,40)];
    buttonSettings.image = [UIImage imageNamed:@"blah.jpg"];
    buttonSettings.userInteractionEnabled = YES;
    buttonSettings.tag = 101;
    [scroller addSubview:buttonSettings];
    Basically no touch events are being generated anywhere I click within the scroll view and I'm at a loss to work out why.
    Not sure if it's related either but I can't get a UILabel to respond to a touch either, even though I've enabled userInteractionEnabled for it - even trying a simple project I can't get a UILabel to generate a touch event at all.
    Any help on the above scroll view issue would be appreciated as it's driving me nuts!
    Cheers

    UIScrollView must not pass these events up the responder chain. I'm not sure if this is intended behavior, but it seems like it might be (if so the docs should be updated). I took my test code and verified:
    1. scroller's nextResponder points the UIView of the ViewController.
    2. That UIView has a nextResponder pointing to the ViewController
    This is what you would expect from the docs on the UIResponder Chain. However, it relies on each UIView subclass to pass the event up the responder chain +if it isn't handled fully+. UIScrollView must be making the assumption that "the buck stops here". Hence your touchesBegan: in your viewController never gets the message.
    Further, a little more testing with this at the end of viewDidLoad:
    BOOL status1 = [scroller canResignFirstResponder];
    BOOL status2 = [scroller resignFirstResponder];
    BOOL status3 = [self.view becomeFirstResponder];
    showed me:
    status1 = NO
    status2 = NO
    status3 = NO
    I'd say UIScrollView likes the power it wields .

  • How to add a UIResponer object in the Responder Chain ?

    Hello,
    I'm quite new in iPhone developement and in Objective-C programming, and I am not very good (of course I'm French :)).
    I'm sure my problem is simple, but I can't find a clear response in the doc and on the Web..
    I have a custom view which implements the touchesBegan, touchesMoved, and touchesEnded methods in order to handle touch screen events. For a clear separation between View and Control (MVC pattern), I want to delegate these events to another class which inherits from the UIResponder class. How can I do that ?
    I think I have to move the touchesBegan and touchesMoved methods into my new UIResponder class, but how can I indicate to the View that it must forward the events to my new UIResponder class ? In the doc (iPhone OS Programming Guide, Event Handling) it is said that we have to modify the Responder Chain, but I don't know how to do that... In the init method of my custom view, I just can't call the becomeFirstResponder method with my UIResponder class as a receiver because the canBecomeFirstResponder return NO.
    Please help me ! I'm sorry to be such a noob.
    Thank you !!

    I think my problem is near to be solved : I have overriden the nextResponder method and returned my UIResponder object in my custom view . So I can handle the touch events in the responder. But the canBecomeFirstResponder still return NO in the init method of my custom view. Does someone know about that and can explain it to me ?
    Thanks !

  • HT1688 iPhone 4 home button problem

    Good afternoon,
    I have an iPhone 4 and it still in good condition but sometimes, the Home button doesn't respond quickly or doesn't respond at all. What to do?

    I seem to have fixed my iPhone 4 home button problems.
    1. Sync phone and back up.
    2. Go back and resync phone but uncheck all the apps you have purchased/downloaded so that your iphone will have no additional apps on it.
    3. Now reset your phone as a NEW PHONE.
    4. When reset as NEW, unplug it and try home button functions. I'll bet they work just fine, like mine did.
    5. Now that you are satisfied you can resync your apps, but be choosey. Re-install only a couple at a time, and test your home button each time. You'll soon find out which of your apps is causing the problem. It's time consuming and irritating, but it certainly works.
    So far - no problems with my selected re-installed apps. My home button works fine.
    However, I recently purchased several photography apps and an emoticon app and that was when the problems appeared to have started.
    So I've been very selective in putting only the apps I want back on ... for now.
    Hope this helps.
    I will report back to tell you if this complicated but effective solution has worked for me.

  • HT1937 tengo el iphone 5 y mi problema es que mis mensajes de texto estan siendo compartidos con otro telefono que usa mi misma apple id ,necesito borrar mi cuenta y crear una cuenta nueva, como hago?

    tengo el iphone 5 y mi problema es que mis mensajes de texto estan siendo compartidos con otro telefono que usa mi misma apple id ,necesito borrar mi cuenta y crear una cuenta nueva, como hago?

    Tiene razon Zeruelrojo, apple es una mierda, tengo 208 pesos, queria gastarlos en aplicaciones, antiguamente usaba mi cuenta y compraba en 1 ipod touch 2g y sin problemas, adquiri 1 iphone 3g de 8gb, asocie mi cuenta con el dispositivo y hasta ahi no habia problemas, pero a la hora de comprar aplicaciones o accesorios dentro de las apps, me pide que responda preguntas que no recuerdo haber agregado en mi cuenta de apple, y dije ok no hay problema, debe haber 1 forma de resetearlas, y si la hay, pero a la hora que revise mi contacto de recuperacion veo que el correo ya esta dado de alta y no es el mismo de mi cuenta
    veo que el correo es el siguiente
    SOY DE MÉXICO, cuando carajos agregue un correo de españa? la terminacion en la imagen se muestra ".es"
    ahora, tiene que haber 1 forma de resetear ese correo, andube buscando y no la hay al parecer, todo tiene que ser por soporte tecnico o de alguna manera, lo que le estan haciendo a los usuarios como nosotros, que hacemos TODO LEGAL
    practicamente me estan negando el hacer uso de mi dinero y eso me enoja y me molesta, escribo esto en domingo 07/abril/2013
    mañana hablare directamente con alguien de soporte tecnico....
    si no me resuelven mi problema pueden olvidarse de que siga consumiendo tanto productos como dinero electronico.
    les sugiero que hagan lo mismo, ya que esto para 1 demanda se que no haran nada.
    podran ver que si nos unimos quizas en 1 futuro hagan algo al respecto.
    Soy tecnico informatico y el servicio tecnico que ofrecen es una mierda, disculpen mi vocabulario pero eso es.....
    esta mal estructurado y mal hecho su servicio de ayuda al cliente.
    saludos desde querétaro méxico.
    <Email Edited by Host>

  • My iphone 5 has a problem with signal

    My iphone 5 has a problem with signal, it always search for network. I had removed and plug sim card again but it doesn't work. Then I restore the iphone, and an exception was throw "... An unknown error has occured (3)."

    unknow error 3 means the computer has lost communication with the device during the restore. It can be anything from bad cable, USB port, phone hardware etc.
    Since your phone had a signal issue before, it would be your baseband chip faulty and when the restore tries to connect with the baseband chip to check (it does this when you restore) it waits till the chip responds then times out when it doesnt get any response. The restore will try this several times then eventually restart the phone to get out of the loop. As the phone gets restarted (or shutting off) itunes think the phone turned off and throws error 3.
    Go to apple if it's under warranty. If not try to find where they do chip replacement as this is not something that you can do yourself.

  • NSDocument not in the responder chain

    This is my first Mac OS X Cocoa application. I am trying to create a menu item that will grab information from a document window, do something with that info, and then close the window.
    MessageDocument is an NSDocument subclass.
    I added the method "- (IBAction)deliverTheMail:(id)pId" to MessageDoucment
    I created the Menu item and sent the action "deliverTheMail" to the First Responder.
    The problem I'm running into is that even after I create a MessageDocument window the menu item never becomes enabled. Shouldn't the NSDocument be in the responder chain?
    Am I even taking the right approach here? And if so why isn't it working?

    I think my problem is near to be solved : I have overriden the nextResponder method and returned my UIResponder object in my custom view . So I can handle the touch events in the responder. But the canBecomeFirstResponder still return NO in the init method of my custom view. Does someone know about that and can explain it to me ?
    Thanks !

  • IPhone 5s in-call problems

    I received my iPhone 5s last week and because I am the mother of an infant (and am clumsy), I thought I would get a very protective case. I bought a Lifeproof case but in calls, it would vibrate on and off the entire time. I thought something was wrong with my phone but upon doing a search, I found out that is a common issue with those cases. So I exchanged it for a Survivor+Catalyst case and in that case, in calls, I kept getting a terrible screeching sound. When I tried searching for issues with that case, I didn't find anything. So I exchanged it for another case - the same kind - and I have the same issue. At the same time, my husband's iPhone 5s experienced no problems whatsoever in his Lifeproof case, and now that he has a Survivor+Catalyst case, he has no problems with it either. Is there something wrong with my phone that is causing these problems? They only happen when in the cases but it seems odd that no rugged case seems to work with my phone.  I need a case that is very protective. I am wondering if there is a speaker problem that only becomes apparent when in a case, perhaps particularly in cases that completely cover the entire phone. Please help!

    Connect your iPhone to iTunes on your computer and do a Restore to Factory.
    See here: Use iTunes to restore your iOS device to factory settings - Apple Support

  • IPhone app store downloading problem

    I have iPhone app store downloading problem (iOS 5). I could not download or update any software successfully from yesterday. Every app shows "waiting for download" but nothing happen for two days. It seems my app store does not connect to server. I use same account in my iPad, but it works normal. So, what happen to my iPhone? Please help me!

    Hold the home button and lock button for 10 seconds to reboot the iPhone.

  • Iphone 4s earphone voice problem

    i have iphone 4s it has problem with earphone. the earphone voice of of other caller is very less. i can hardly head the other person but the speakers are working perfectly alrights. someone told me that the earphone speakers are burst. but some other people tole me that iphone 4s got a bug and my problem would be solved by updationg software. can anyone tell me the right solution.
    regards
    sheraz mumtaz

    Hey Ocean20! Hope you Aussies had a lovely day celebrating Anzac Day!
    Does that mean you got to have a day off from work?
    Cheers!
    GB

  • Face time fades out and then tries to reconnect on new ipad retina display on WiFi.  Iphone 4s has no problem with face time from exact same location and same contact.  WiFi signal strong on both devices.  What gives?

    Face time fades out and then retries to connect (new Ipad Retina Display) on WiFi. Iphone 4s has no problem with face time from same location and same contact.  What gives?

    rdallas001 wrote:
    Is the router to small?
    Not necessarily, if you are using Facetime all the data goes through your WiFi router, your cable/DSL modem, your ISP and the internet to Apple's Facetime servers and then, in reverse, down to the Facetime recipient. If your ISP connection is too slow or there is excessive traffic on the internet you can have Facetime problems.
    Most WiFi routers can handle this unless others in the house are also using WiFi at the same time. The problem may be your ISP connection or congestion on the internet, etc.

  • When I close my iPhone and I want to open it to use it again, the opening process takes more than an hour, I regretted to buy the iPhone because of this problem that you do not suffer at all with Nokia,how I can solve this problem?

    When I close my iPhone and I want to open it to use it again, the opening process takes more than an hour, I regretted to buy the iPhone because of this problem that you do not suffer at all with Nokia,how I can solve this problem?

    mostafa182 wrote:
    ... how I can solve this problem?
    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414
    If you try all these steps and you still have issues... Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • HT201272 You seems not to understand what I mean and what I'm having like problem. I still have my payment recut  from October of this year when I bought 9 songs in the iTunes Store from my iPhone 4S. The problem is from all the 9 songs, 7 are still avail

    You seems not to understand what I mean and what I'm having like problem. I still have my payment receipt  from October of this year when I bought 9 songs in the iTunes Store from my iPhone 4S. The problem is from all the 9 songs I've paid for, only 7 are still available from this list on my iPhone. There is no possibility to download the other 2 without paying for them. I've spoke to the lady from Mississippi on the phone 2 days ago from about 2 hours calling from Belgium but unfortunately she couldn't help me. It's the 3rd time I complain about this. How many time shall I pay for the same songs?? If you can access my music list and my past receipts payment you will be able to find out what I mean. I went back on iTunes I've found the the songs I already downloaded in October that should be on my playlist but if I click on them it will charge me again 0,99 cents. It's been 3 years I've been using the same apple ID with my iPhones. I just wand to get my songs back without having to pay them twice or 3 times

    1. iTunes won't offer cloud downloads for songs that it "thinks" are in your library, even if it "knows" the files are missing. If you've exhaustively searched for the missing files and there is no prospect of repair by restoring to them to their original locations, or connecting to new ones, then delete that tracks that display both the missing exclamation mark and are of media kind Purchased/Protected AAC audio file. Don't hide from iTunes in the cloud when asked, close iTunes, then reopen. You can download from the cloud links or iTunes Store > Quicklinks > Purchased > Music > Not on this computer > All songs > Download all.
    2. Why? Not sure, perhaps 3rd party tools or accidental key presses combined with previously hidden warning messages when trying to organize the library. There is a hint that using the feature to downsample media as it is synced to a device may also be involved, though I've not replicated it. Whatever the reason a backup would protect your media.
    tt2

  • I can´t sync iCal events written in the iphone4 to the macbook ical, but conversely from macbook to iphone there´s no problem, can somebody help me?

    I can´t sync iCal events written in the iphone4 to the macbook ical, but conversely from macbook to iphone there´s no problem, can somebody help me?

    Thanks for your answer! I tried as you say, erase the Sync History, but now does not sync any calendar, only displays the birthday ...do not know whatelse to try.

  • Iphone 4s bluetooth volume problems through Alpine HU

    Having trawled through numerous reports of bluetooth problems with the 4S I have not found one which replicates my issue although I could have missed it.
    Essentially I think my query boils down to " Does the 3GS output music, via bluetooth at a higher level than the 4S, assuming both using IOS5.0.1" .Because my new iphone 4S is much much quieter than my old 3gs and I want to establish whether this is a software problem or a faulty unit.
    For the last couple of years I have been using a 3GS which paired perfectly with my Alpine CDA-9887/Bt400 stereo in the car, handled calls well and when playing music via the bluetooth input ( which it did exceptionally well) it was at the same sound level as the other inputs for a given vol setting, i.e. I could switch from radio, to disc to bluetooth withouth changing the volume.
    Having just changed to an iphone 4S I have found that although the unit pairs ok and seems to handle calls well enough (although rather mushy sounding compared to 3GS) it is very quiet when using the ipod function via bluetooth.
    Volume and sound quality are very subjective I realise but to give an indication of the problem, the Alpine head unit has a volume scale from 0-39. On all inputs (except with the 4S) a volume of 5 is fine for spoken voice, 12 good for music on the move 21 is very very loud pushing the cars speakers to the limit. These levels are approx the same when playing music through an iphone 3GS and an ipod touch via bluetooth.
    By contrast the iphone 4S is inaudible at vol 5, needs 20 to be listenable to on the move and even at vol 39 sounds thin and about as load as a 3GS at vol18  so ful vol not possible from my iphone 4S
    The main problem with this is that if you are listening to music from the iphone 4S then switch to the radio without remembering to drastically reduce volume it is likely to result in damage to the speakers and/or your eardrums. The problem is compounded as I use the TomTom app regularly and this exibits the same problem, the volume needs to be very high for instructions and then if I change input to listen to the news....ouch.
    I have tried 2 iphone 3GS's and an ipod touch on this Alpine unit and they all work perfectly, being able to maintain the same output for a given HU vol level as the radio etc. I have tried increasing the bluetooth volume on the 4S handset, have tried clean restore to see if there is some obscure problem with my backup all to no avail.
    Has anyone upgraded from a 3GS to a 4S and found the music level in a car via bluetooth much quieter, the same or louder and does this sound like a hardware problem.
    thanks.

    Funny Apple told me to eat **** and call my car place.
    HELP !!!
    It’s not like we are working with Samsun here. They should have thought it out fixed all the bugs then went ahead. I am...... ******!  My 3 week old Volkswagen Tiguan no longer plays my MUSIC nor my Audible. Its so not ok. This is a breach of contract. I am told by apple you don’t have to update but my carrier said just the opposite our phones will not work without the updates...
    Apple get you crap together, I had such respect you. You have let a lot of apple fans down.
    A very ****** ex Apple Fan

Maybe you are looking for

  • Screen Goes Black During Startup (after login)

    Hello, I have a 2005 Mac Mini PPC OS 10.4.11. This is the first problem I've had since purchasing the computer. This problem popped up out of nowhere. The screen goes black during startup just after I login into my account. I can hear the hard drive

  • ABZO Posting with T Type 100 By LSMW ( with Dep areas restriction)

    Hi Gurus I have few hundreds of Assets that are created before the Activation of New dep Areas. Now i have to updated the Acquisition costs to those 10 and 11 Dep areas only. I am able to do the update the acquisition costs to Asset master by ABZO tc

  • Unable to import ringtones to iTunes 10.6.1

    Hi guy, I have encountered a iTunes problem recently.I wanna sync ringtones to my iPhone 4 but I could not import any of ringtones to library > ringtones. All the ringtones I could sync to my iPhone 4 before.They are m4r format and the playing time o

  • BI CONTENT IMPLEMENTATION

    Hi Friends,                       I just need some help from you experts, actually i have installed BI Content and shown 130 standard business content reports from those, now they are asking me to transport all the standard business content queries t

  • How to run audio from hdtv thru sb audigy 2

    I just purchased a hdtv that has an optical cable output. I would like to run the hdtv audio thru my sb audigy 2 zs soundcard to take advantage of the surround sound. I've read that the audigy 2 zs does not have an optical input, but am unclear which