Timer & Touch Event Problem

Hi all,
I am developing a block game in iphone & i am facing problem in timer & touch event.
The timer goes slower down & the app stuck on the device as well as simulator after sometime.
Also when a particular block is touched.. the events are not fetched properly..
Please comment if you have any suggestion.
Thanks
Jaya

I remember slightly is has something to do with runloops.
If I am not wrong, timers and events get added to the current NSRunLoop and processed in the order of entry. If your runloop is full with stuff things might maybe slow down or get dropped.
Not sure if thats 100% how it works, but maybe check the documentatoion for RunLoops/Timer

Similar Messages

  • Time period over which finger taps are grouped together as one touch event

    Is this a value we can set ourselves? eg. making it longer so that two taps that are further apart are recognized as a part of a single touch event. Thanks.

    I just was hoping to try the "little guns" for such a little task.
    Maybe you should have used an even simpler application like MPEG Streamclip. If file names (either originals copied to your HD or those imported by iMovie '08) are in their proper sequence order, then simply drag and drop all of the files to the MPEG Streamclip work area (or use the "Open files" option to select the entire sequence via the Finder browser), fix time code breaks (Command-F), and then save the files in their current compression format (MPEG2/AC3 multiplexed file or MOV with I-framed MPEG2 video and AIFF audio) using the "Save As..." option or (if you have the QT MPEG-2 Playback Component installed) export as DV, AIC, or other target format as preferred for further editing, DVD burning, Internet uploading, etc.

  • [iPhone] Touch event and countdown timer

    Hi all,
    in my app I want to have a uilabel in my mainview which displays a countdown from a chosen number of seconds. This shouldnt be too hard. But now comes the clue. I only want the timer to start the countown when there are no touch events at all. So every time the user clicks a button, changes to a different view or does anything else the timer should start counting down from the begining again.
    How would you do this?
    How do I termine if there is a touch event anywhere in the app?
    Do I use NSTimer?
    Thanks for taking your time and making thoughts!

    From what you've said, you are going to decrement a variable every second unless the user does something on the screen, right? If so...
    Create your variable and set it to the starting value, say, 10 seconds.
    Set up your timer to call a given method (@selector:myCountdownMethod) every second.
    The method should decrement the counter every time it is accessed (i.e. every second), then update your UILabel. It should also handle what happens when the counter hits zero.
    Next, your touchesBegan method should simply set the counter value back to its original starting value, i.e. 10. The timer will still trigger every second and decrement the counter, it'll just never hit zero unless the user doesn't do anything for 10 seconds.
    Hope this helps.

  • Time zone event shifting problem - please help

    Hi,
    I have a question: i have done my calendar in ical. I travel with my computer constantly and would like to change time zones accordingly, so my emails and emails i receive are displayed with correct time, etc.. I did my calendar when I was in the US (EST), now that I am in Europe and I change the time zone in the preferences, all my events shift 6 hours. If i enable time zone support in ical preferences, it seems to give me an option to assign each event a different time zone. don't want or need this. Can i avoid ical shifting my (correct) times for events alltogether??
    Many thanks for your help!

    Just found a utility recommended on a different thread to this same question: http://discussions.apple.com/thread.jspa?messageID=3854700&#3854700
    The download link for the utility is, http://www.versiontracker.com/dyn/moreinfo/macosx/19409.
    I have not tried it out, but it certainly seems to address the right issue.
    Ron

  • Switching touch events from symbols/classes to the main stage?

    For previous threads:
    http://forums.adobe.com/thread/864057
    http://forums.adobe.com/thread/863566
    http://forums.adobe.com/thread/864262
    http://forums.adobe.com/thread/863597
    Bug ID #2940816
    I have an app that wasn't compiling correctly. I sent the bug to Adobe who responded with a workaround. However, I can't figure out how to make their stated workaround work in my code.
    I have puzzle pieces on the stage. Each is assigned to a separate class. Inside the class I have touch events defining multiple touch events for each piece.
    I have another spot on the stage where, when it is touched, a puzzle piece appears. These are also each linked to a separate class. Inside this class I also have touch events defining multiple touch events for each piece.
    Though it works fine on my computer, it wasn't working on an iPad. Adobe said that I needed to switch the touch events so that they were assigned to the main stage instead of to each individual object.
    However, the code they gave me didn't really make sense in context and I'm confused how to implement it.
    This is the code in the class for each piece that is created when you touch the stage:
            public function GeoPiece(): void {
                if (PuzzleGlobals.currentLevel == "Name") {
                    this.gotoAndStop("wholeName");
                else if (PuzzleGlobals.currentLevel == "Abbrev") {
                    this.gotoAndStop("abbrev");
                else if (PuzzleGlobals.currentLevel == "Shape") {
                    this.gotoAndStop("shape");
                this.addEventListener(TouchEvent.TOUCH_MOVE, geoPieceBegin);
            public function geoPieceBegin (e:TouchEvent): void {
                PuzzleGlobals.pieceActive = true;
                e.target.startTouchDrag(e.touchPointID, false);
                e.target.addEventListener(TouchEvent.TOUCH_END, geoPieceEnd);
                e.target.interactionBegin();
                MovieClip(this.parent.parent).nameDisplay.gotoAndStop(e.target.abbrev);
                PuzzleGlobals.currentPiece = e.target.abbrev;
            public function geoPieceEnd (e:TouchEvent): void {
                PuzzleGlobals.pieceActive = false;
                if (currentObjOver.isLocked == true) {
                    currentObjOver.gotoAndStop ("Lock");
                else {
                    currentObjOver.gotoAndStop ("Out");
                MovieClip(this.parent.parent).nameDisplay.gotoAndStop(PuzzleGlobals.chosenPuzzle);
                e.target.stopTouchDrag(e.touchPointID);
                if (this.dropTarget.parent is GeoPuzzle) {
                    if (GeoPuzzle(this.dropTarget.parent).abbrev == e.target.abbrev) {
                        PuzzleGlobals.statesCompletedUSA++;
                        GeoPuzzle(this.dropTarget.parent).isLocked = true;
                        GeoPuzzle(this.dropTarget.parent).gotoAndStop("Lock");
                        e.target.parent.removeChild(DisplayObject(e.target));
                    else {
                        //play BOOP sound indicated wrong drop;
                if (PuzzleGlobals.statesCompletedUSA == PuzzleGlobals.TOTAL_NUMBER_USA) {
                    //play fireworks game
                else {
                    //do nothing
                e.target.removeEventListener(TouchEvent.TOUCH_END, geoPieceEnd);
            public function interactionBegin () {
                if (this.dropTarget != null && this.dropTarget.parent is GeoPuzzle) { //check to make sure it's over a puzzle piece
                    currentObjOver = GeoPuzzle(this.dropTarget.parent);
                    currentObjOver.gotoAndStop("Over");
                if (lastObjOver != currentObjOver) {
                    if (lastObjOver.isLocked == true) {
                        lastObjOver.gotoAndStop("Lock");
                    else {
                        lastObjOver.gotoAndStop("Out");
                    lastObjOver = currentObjOver;
    This is the code in the class for each piece that's already on the stage:
            public function GeoPuzzle(): void {
                if (this.isLocked == true) {
                    this.gotoAndStop ("Lock");
                if (PuzzleGlobals.pieceActive == true) {
                    this.addEventListener(TouchEvent.TOUCH_BEGIN, geoPuzzleBegin);
            public function geoPuzzleBegin (e:TouchEvent): void {
                e.target.addEventListener(TouchEvent.TOUCH_END, geoPuzzleEnd);
                e.target.gotoAndStop("Over");
                MovieClip(this.parent).nameDisplay.gotoAndStop(e.target.abbrev);
            public function geoPuzzleEnd (e:TouchEvent): void {
                if (e.target.isLocked == false) {
                    e.target.gotoAndStop("Off");
                else if (e.target.isLocked == true) {
                    e.target.gotoAndStop("Lock");
                MovieClip(this.parent).nameDisplay.gotoAndStop(PuzzleGlobals.chosenPuzzle);
                e.target.removeEventListener(TouchEvent.TOUCH_END, geoPuzzleEnd);
    You can see that each piece (whether it's already locked on the stage or movable) reacts differently to different touch events. However, this is the code that Adobe gave me as a workaround:
    this.stage.addEventListener(TouchEvent.TOUCH_BEGIN, onTouchEvent);
    this.stage.addEventListener(TouchEvent.TOUCH_MOVE, onTouchEvent);
    this.stage.addEventListener(TouchEvent.TOUCH_END, onTouchEvent);
    var beginCount:uint=0;
    var moveCount:uint=0;
    var endCount:uint=0;
    function onTouchEvent(event:TouchEvent):void{
         switch (event.type){
              case TouchEvent.TOUCH_BEGIN:
                             trace("BEGIN")
                             beginCount++;
                             square.x = event.stageX;
                             square.y = event.stageY;
                             square.startTouchDrag(event.touchPointID, false);
                             break;
              case TouchEvent.TOUCH_MOVE:
                             trace("MOVE")
                             moveCount++;
                             break;
              case TouchEvent.TOUCH_END:
                             trace("END")
                             endCount++;
                             square.stopTouchDrag(event.touchPointID);
                             break;
         trace("begin: "+beginCount+" move: "+moveCount+" end: "+endCount);
    //     countText.text = "begin: "+beginCount+" move: "+moveCount+" end: "+endCount;
    This doesn't make any sense to me because it seems that it would only work if touching the stage had to react in just a single way. I have multiple pieces that need to each react differently.
    1. The pieces that are locked to the stage need to highlight when touched and display their name.
    2. These pieces also need to keep themselves highlighted and their names displayed when the touch is dragged off of them instead of just removed.
    3. Each piece needs to be created when touching the Puzzle Piece button the stage. As these pieces are dragged, they need to highlight the pieces underneath them and unhighlight them when they are dragged off. They also need to display their own names, and lock into place when they are dragged over the correct piece.
    My questions are:
    1. Why don't touch events work in the compiler?
    2. How can I translate my current working code's touch events to all be directly linked to the stage instead of their objects?
    Thanks so much!
    Amber

    I am going to copy and paste this answer into all of the forums I've asked this question in case some noob like me comes along and needs the answer.
    I found the problem! After 3 months I finally figured out what was wrong and why my app was working in Device Central when exported as Flash 10.1 and not on my iPad when exported as AIR for iOS.
    The problem is that in the Flash runtime, if a line of code returns a bug, the flash runtime says "Error, shmerror, try again next time." So I had one if, else statement that was executing when it wasn't supposed to be - only once, at the very beginning of the program. It was throwing an error. When I exported as Flash, flash didn't care, and still executed the code later when it was supposed to. But Apple won't let their programs crash. So instead of just trying that code again, Apple decided, after the first error was thrown, that it would then COMPLETELY IGNORE that line of code. So the error was in the line where the states would unhighlight themselves. Apple just shut down that line of code, that's why it wouldn't execute properly.
    I ended up changing this line of code
    if (lastObjOver != null && lastObjOver.isLocked == true)
    which threw an error when the piece was FIRST dragged over the puzzle, to to this
    if (lastObjOver.parent != null && lastObjOver.isLocked == true)
    which wouldn't throw the error.
    Problem solved!
    If anyone else is having this problem, I suggest you do what I did. Change all your touch events to mouse events so you can run the program in the adc debugger. That's when I discovered the error being thrown.

  • How to implement drag and drop functionality in a HTML5 webpage using touch events?

    Hi all,
         I need to create a webpage having two parts.One part is having set of SVG images into it and other part is having canvas.I need to drag those image onto the canvas allowing same image for multiple times and those images on the canvas are movable inside the canvas only. This webpage is only used in iphone or ipad like touching devices so I need to handle touch events.
         There is already jQuery plugin for drag drop functionality but it is not supported for touch events.
    It is only for desktop veriosns.So if you know about any jquery plugin let me know.
         So please help me to carry out this task.

    I have tried using the same but still not working.
    I have handled touch events like touchstart,touchend,touchmove.
    But the problem is when I drag the image from upperbox onto canvas, the clone of that image is creating but the image which I dragged on canvas gets vanished.
    I am creating clone because I want to add multiple images onto canvas.
    Atik

  • [IPhone SDK] NSTimer conflicts with touch events

    Hi all,
    i've an NSTimer that refresh the UIView at 30 fps. Below there is the scheduled timer:
    animationTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(refreshAll) userInfo:nil repeats:YES];
    The problem is that the app doesn't wrap the touch events (touchbegan, touchesMoved and touchEnded) because the timer interval is too low and conflicts with this events.
    I tried to set the animation interval to 2 seconds and the touch events works but the rendering obviously is slow.
    However the problem is only on the device because when i launch the app on the simulator i have no problem with the timer.
    Can anyone tell me how I can solve this problem?
    Thanks

    The game I'm developing for the iPhone has 2 play modes (the second mode has more on screen objects). In the first game mode, I get a solid 29-30 frames per second (acceptable), however the second mode with more objects gives me 25 fps (slightly jerky). BTW, on a PC with modern hardware I get >1300 fps @1680x1050.
    At first I thought that the NSTimer resolution might be causing problems. The Apple demos all use a resolution of 1/60. Setting a value of 0.0 actually bumps the frame rate up by few frames, but I lose the ability to process touch input (crap). Adding usleep(a_delta) hoping to invode a context switch does nothing for the touch input.
    The next thing I tried was creating a dedicated rendering thread which basically does a while (1) render(); The thread will loop as fast as it can, and I regain touch input. On the plus side, I gained 3-4 fps for both game modes, so now I can hit 30 fps for the second mode (sweet).
    To make this work, I obviously needed to add locking primitives between the render thread and the iphone input (touch, sleep, phone call etc). The render loop is now basically:
    while (alive)
    aLock->Lock();
    render();
    aLock->Unlock();
    Anyway, I thought people would appretiate my experience when looking to squeeze a few more frames out of the iPhone. You just need to understand multiprocessing to work out the synchronisation issues.
    PS. There is some interesting advice in the following thread:
    http://discussions.apple.com/thread.jspa?messageID=7898898&#7898898
    Basically, they set invoke the runloop from the animation method. This might be simpler than spawning threads and handling locking, but I haven't tried it.

  • Touch events don't work on an actual device?

    I'm posting here because I'm not sure where else to put it.
    I have a (semi) functioning prototype of an app and am trying to test it on an iPad.
    But when I export and install the ipa on my iPad through iTunes and Launch, most of the functionality is gone. In fact, all that happens is my buttons light up. Nothing does anything else.
    I'm (hoping) I'm just missing something simple like a publish setting wrong.
    Player: AIR for iOS
    Script: Actionscript 3.0
    Included .swf, .xml, and all relevant .as class files
    Published using quick publish for device testing
    And that's it. I opened the .ipa in iTunes and synced. And nothing works.
    What am I doing wrong?

    I am going to copy and paste this answer into all of the forums I've asked this question in case some noob like me comes along and needs the answer.
    I found the problem! After 3 months I finally figured out what was wrong and why my app was working in Device Central when exported as Flash 10.1 and not on my iPad when exported as AIR for iOS.
    The problem is that in the Flash runtime, if a line of code returns a bug, the flash runtime says "Error, shmerror, try again next time." So I had one if, else statement that was executing when it wasn't supposed to be - only once, at the very beginning of the program. It was throwing an error. When I exported as Flash, flash didn't care, and still executed the code later when it was supposed to. But Apple won't let their programs crash. So instead of just trying that code again, Apple decided, after the first error was thrown, that it would then COMPLETELY IGNORE that line of code. So the error was in the line where the states would unhighlight themselves. Apple just shut down that line of code, that's why it wouldn't execute properly.
    I ended up changing this line of code
    if (lastObjOver != null && lastObjOver.isLocked == true)
    which threw an error when the piece was FIRST dragged over the puzzle, to to this
    if (lastObjOver.parent != null && lastObjOver.isLocked == true)
    which wouldn't throw the error.
    Problem solved!
    If anyone else is having this problem, I suggest you do what I did. Change all your touch events to mouse events so you can run the program in the adc debugger. That's when I discovered the error being thrown.

  • How to get a touch event in a UIWebView object?

    I have looked around and several people have had the same question but a workable answer has not arisen. I want to detect a touchesEnded() event in an area which is covered by a UIWebView() control. Normally a webview eats all the touches; I don't want to use the trick of having a transparent UIView on top of my UIWebView to grab the touches because I want to let most of the touches through to the UIWebView control so that the user can scroll. I suspect I have to grab events at the higher level and filter them, apparently subclassing UIWebView doesn't pass the events through, surely someone has solved this very fundamental problem.

    I have been working on same problem. I came to following conclusion. There are two ways to handle:
    1. Subclass: WebView doesn't forward touch events by blocking in hitTest function. But link clicking works
    2. Transparent subview of WebView: Touch events obtained through transparent view can be forwrded to scrollview subview of webView and all seems working. But link linking fails. It seems like touch event for link clicking is handled by webView only. It does it before other touch events are processed. So there is no point in passing those touch events to webView. WebView doesn't expose way to handle click handling.
    Correct me if wrong. If someone has solution please post.

  • Can Touch Events and Swipe Events exist in the same frame and/or movie?

    After having fully tested a file with touch events I decided to add both a touch event and swipe event to a frame.
    I started by importing the following statements:
    Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
    Multitouch.inputMode = MultitouchInputMode.GESTURE;
    I then added th appropriate code but only touch events worked. I fiddled so more and only the gesture events worked. So before I move any further, I'm wondering if I'm wasting my time trying to get them to work together.
    So my questions are:
    Can Touch Events and Swipe Events exist together in the same frame?
    Can Touch Events and Swipe Events exist scene?
    A reference to more information about this would be helpful, if you know of any.

    I am aware of the latest releases of the components along with the plug-ins.
    This note is applicable to your scenario but you might face some issues related to organization rule wizard, custom user group creation and EAM DB log collection, as mentioned at the bottom of the note. No matter on what SP level you are with GRCFND_A at 10.1, you would face these issues.
    And so far, i don't think there is any more update from SAP on co-existence of plugins of 5.3 and 10.1
    Ameet

  • BADI for time m. events

    Hello,
    We need to move all our user exists of time management events (pa51, pa61,...)(PBO & API)to a BADI which also would have effect in the interface between Portal and R3.
    Do you know which BADI we have to implement?
    Thanks in advance.

    Hi fariba,
    Have you solve this multiple entries problem in LIST ENTRY?
    I know this is doable for 'WEEK' but not 'LIST ENTRY'.
    Could you share us your experience?
    Thanks,
    Guorong

  • TOUCH SCREEN PROBLEMS IN IPHONE

    WANTED TO KNOW IF ANYONE IS EXPERIENCING TOUCH SCREEN PROBLEMS WITH THE UPPER HALF PORTION OF THE IPHONE. IN THE PHONE MODE THE 1, 2 & 3 NUMBERS DO NOT RESPOND TO MY TOUCH. IN THE HOME SCREENS, NOTHING IN THE FIRST ROW OF ICONS RESPONDS TO MY TOUCH.
    I HAVE ALREADY RESET, RESTORED AND LOADED THE UPDATED SOFTWARE.
    VERY FRUSTRATING. HELP.

    When restoring my phone didn't work, I backed up my data and made an appointment at the Apple Store. I went prepared to argue my case as my phone was over a year old (I got it the first day it was out) and didn't do any thing to damage the phone. It just developed this dead spot. I was honest about how long I had the phone and expressed that this was a common problem that is all over the internet and from what I could tell, I wasn't the only one in there for this problem. I was tipped off by a question he asked, "What row went dead?" He obviously had seen this enough times to know that different rows in the home screed went bad. I told him the second row. The conversation went on and somewhere there was some back room talks and they replaced my phone, which was very nice, but I'm betting this doesn't happen all the time. I think I got lucky. Over all I give Apple a 10 out of 10 for Customer Support. I doubt I would be so generous if I had to buy a new phone. I was told at first that it was going to cost me $249.00 to repair the phone, maybe he said $199. At any rate, I would have bought a new G3 instead of getting this one repaired. I tried to get the Apple Care on the replacement phone but they wouldn't allow that. So I have a 90 day warranty right now. I highly recommend that you get Apple Care on the iPhone. I'll be getting it on my next one. I don't know if this phone is new or a refurbished phone. It looks new, but I'm guessing it's refurbished. All in all I'm hoping that Apple realizes this is a problem with the screen and it's a problem that they need to fix or continue to fix when they go bad for no good reason. Well that's been my experience hope yours turns out as well.

  • Mouse event problem (NEW problem)

    Sorry guys...
    The last problem was solved, yes... but another one has shown
    up!
    Remember the code:
    txt82.visible = false;
    botao82.addEventListener(MouseEvent.MOUSE_OVER, botao82over);
    botao82.addEventListener(MouseEvent.MOUSE_OUT, botao82out);
    botao82.addEventListener(MouseEvent.CLICK, botao82click);
    function botao82over(event: MouseEvent)
    txt82.visible = true;
    function botao82out(event: MouseEvent)
    txt82.visible = false;
    function botao82click(event: MouseEvent)
    gotoAndPlay("video82");
    where i wanted a texto to show or hide depending on the mouse
    event?
    Ok...
    Now, when i CLICK, i'll go over to "video82" allright, but
    i'll ALSO get an error!
    "Cannot access a property or method of a null object
    reference" - on botao82out
    which means that: when i click and move up to "video82", the
    mouseout is also called to make the text dissapear but the function
    is no more available because we've moved up to another time.
    Any possibilities?
    Erik.

    Hi Haran,
    bota82 IS the movieclip, which has to be like that because of
    the naming of it's instance, used to get called in the code.
    But anyway, guys, i found the solution! YEP! Increases
    tremendously the code, but... well... it works!
    i had the button layer extended all over the time.
    The problem with this is that when i clicked and went to the
    frame video82, for example, all the buttons still showed as
    clickable.
    How did i solve that?
    More magic! Disappearing magic!
    at the beginning of the code i certify the buttons to be
    visible:
    botao82.visible = true;
    and so on with all of them...
    then, right before the click function, i turned them all OFF
    ! :D
    function botao82click(event: MouseEvent)
    botao82.visible = false;
    botao83.visible = false;
    botao84.visible = false;
    botao85.visible = false;
    botao86.visible = false;
    botao87.visible = false;
    botao88.visible = false;
    botao89.visible = false;
    botao90.visible = false;
    gotoAndPlay("video82");
    Phew! It worked!
    Know what? I think clearer when i discuss the problem with my
    fellows here in the forum! Thanks everyone.
    Hope this helps others in the future!
    Erik.

  • 1046: Type was not found or was not a compile-time constant: Event.

    I am more than a little frustrated.  I'm using Flash Professional CS5.5, attempting to publish ActionScript 3.0 for FlashPlayer 10.2
    My code begins with:
    import flash.events.MouseEvent;
    import flash.events.Event;
    import flash.events.KeyboardEvent;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    Then much later I have:
    teamFourCar_mc.addEventListener(Event.ENTER_FRAME, trackPosition);
    function trackPosition (event:Event)
    and I keep getting a compiler error:
    Scene 1, Layer 'actions', Frame 1, Line 434
    1046: Type was not found or was not a compile-time constant: Event.
    I have imported the class "Events".  I have successfully used the same construction in other scripts... in fact, virtually the same construction is included in Code Snippets as Fade In and Fade Out.  Adding ":void" after (event:Event) makes no difference.  I have Googled - to no avail - and spent the better part of a day reading through the on-line help files, but the solution is still eluding me.
    It's probably so simple I'm going to smack myself in the forehead and mutter "Duh!" when I find a solution...
    If you can do anything to hasten that event (no pun intended) I (with the possible exception of my forehead) will be very grateful.
    TIA
    Terry

    Sinious:
    The entire code of the main movie clip is at http://pastebin.com/JYfLUhh1
    A sample of one of the four "problem" movie clips is at http://pastebin.com/gQGDyngx
    There is nothing wrong with the "problem" clip.  The problems are in the main movie clip:
    Scene 1, Layer 'actions', Frame 1, Line 427
    1046: Type was not found or was not a compile-time constant: Event.
    Scene 1, Layer 'actions', Frame 1, Line 612
    1046: Type was not found or was not a compile-time constant: Event.
    Scene 1, Layer 'actions', Frame 1, Line 1819
    1046: Type was not found or was not a compile-time constant: Event.
    There are the only three occurrences of a function with (event:Event).  Two are ENTER_FRAME (427 & 1819) The other is COMPLETE from Loader.info
    Auto format reported a syntax error "near 'if(movingCar.currentFrame == (dieRoll * 24) + movingCarPosition)' " but I can't detect what, if anything, is wrong with it.
    I'm not an experienced developer... in fact, the last programming I did before taking up Flash three months ago was with QuickBasic under DOS 6.2... therefore, please try not to roll your eyes too much when you see how inelegant the code is.
    I have a working version, but it's over 7,000 lines and a memory hog.  I'm trying to make it more elegant and more efficient.  BTW, the three (event:Event) functions are in the working version in more or less the same places, with the same calling code.
    I hope you can figure it out.
    Thank you in advance

  • [iPhone] - No Touch Events After Selecting Photo in UIImagePicker

    In my OpenGL ES app, after calling the UIImagePicker and selecting a photo (or hitting cancel,) my app no longer registers any touch events.
    Touch events work fine before UIImagePicker is called. I am guess that somehow UIImagePicker (even though I release it) or something else is intercepting the touch events and not passing them along.
    Does anyone have any idea how to solve this problem?
    Photo Controller code:
    - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
    [self UseImage:image];
    // Remove the picker interface and release the picker object.
    [[picker parentViewController] dismissModalViewControllerAnimated:YES];
    [picker release];
    - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
    [[picker parentViewController] dismissModalViewControllerAnimated:YES];
    [picker release];
    - (void)SelectPhoto
    if( [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary ] )
    UIImagePickerController *pImagePicker;
    pImagePicker = [[UIImagePickerController alloc] init];
    pImagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    pImagePicker.delegate = self;
    pImagePicker.allowsImageEditing = NO;
    // Picker is displayed asynchronously.
    [self presentModalViewController:pImagePicker animated:YES];
    - (void)TakePhoto
    if( [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera ] )
    UIImagePickerController *pImagePicker;
    pImagePicker = [[UIImagePickerController alloc] init];
    pImagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    pImagePicker.delegate = self;
    pImagePicker.allowsImageEditing = NO;
    // Picker is displayed asynchronously.
    [self presentModalViewController:pImagePicker animated:YES];
    // Implement this method in your code to do something with the image.
    - (void)UseImage:(UIImage*)theImage
    The code calling the photo controller:
    [g_window addSubview:m_pPhotoController.view];
    [m_pPhotoController SelectPhoto];
    Thanks.

    Some more information:
    If I add a TouchesBegan function to my PhotoController it registers the touches. The stack-trace is:
    #0 0x000315be in -[GEPhotoController touchesBegan:withEvent:] at gephotocontroller.mm:155
    #1 0x30adb941 in forwardMethod2
    #2 0x30a6786b in -[UIWindow sendEvent:]
    #3 0x30a56fff in -[UIApplication sendEvent:]
    #4 0x30a561e0 in _UIApplicationHandleEvent
    #5 0x31565dea in SendEvent
    #6 0x3156840c in PurpleEventTimerCallBack
    #7 0x971545f5 in CFRunLoopRunSpecific
    #8 0x97154cd8 in CFRunLoopRunInMode
    #9 0x31566600 in GSEventRunModal
    #10 0x315666c5 in GSEventRun
    #11 0x30a4eca0 in -[UIApplication _run]
    #12 0x30a5a09c in UIApplicationMain
    #13 0x00002be0 in main at main.m:14
    I tried removing the photo controller's view by calling
    [m_pPhotoController.view removeFromSuperview];
    But to no avail. My photo controller object still captures all the touch events.

Maybe you are looking for

  • Problem deploying web application on WLS 8.1

    Hi, When I try to deploy a web application on weblogic 8.1 it comes back with success.But trying to access it or testing it through admin console gives me the following erors - 403 - Forbidden or 404 - Not found Here is what I am doing My web applica

  • How to return many images to browser?

    hi all im having a servlet which will create an array of images! and i would like to send it to the browser via html, how can i do this? if im confusing, im trying to create a servlet which creates charts as images dynamically, and it should send the

  • How to directly wire in more than one machine

    Hello all, I am probably going to buy this router. Right now I have one machine right near the cable modem so it can be directly wired in. My laptop and Imac can hook up wirelessly. I see that there is one LAN port for a machine to be directly wired

  • How to create parameter with multiple selection in a query (SQ02) ?

    Hi Exports Do you know how to create parameter with multiple selection in a query (transaction SQ02)? thanks.

  • Custom mailbox columns in Mail?

    I'm using Mail 3.5 on 10.5.6. I've been trying set up Mail to display different columns in different mailboxes in ON MY MAC section in the left hand nav panel. Example: I'd like to show Received date in one mailbox without showing Sent date, and vice