Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 912749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:26:16+00:00 2026-05-15T17:26:16+00:00

I have an intermittent bug that is confounding me. Any advice on how to

  • 0

I have an intermittent bug that is confounding me. Any advice on how to track it down or what might be the cause are greatly appreciated.

I have a “DetailView” with a few labels, an Image View and a Text View. In the navbar I also have a camera button to open an Image Picker and take a picture (later added to the image view). Basic stuff.

Sometimes, when taking a picture and then editing the text: the whole view between the navbar and the keyboard goes blank (to my background color). Happens more often the “first time”. Repeating the procedure does not give the same problem. Happens almost only on the 3Gs (very rare on the 3G and the original iPhone).

I have two theories.

1 is that it has something to do with the scroll view that is the container for the disappearing GUI elements. The view hierarchy is: ScrollView -> UIView -> labels, texts and image. Is it a bad thing to have the scrollview as the “main” view?

2 is that it has to do with memory. The 3Gs has a better camera and takes bigger pictures… Possibly something happens if the app gets a low memory warning while taking the picture (not uncommon)?

Are any of these two at all feasible? Any other ideas on what to look for?

thanks

Update:
Could two simultaneous animations cause the bug?

On the KeyboardWillShow notification I resize the ScrollView using the UIView beginAnimations … commitAnimations and right after that (which happens asynchronously I believe) I also tell the scroll view to scrollRectToVisible for the TextView.

like this:

    [UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:animationDuration];
[UIView setAnimationCurve:animationCurve];

CGRect rect = [[self view] frame];
rect.size.height -= keyboardFrame.size.height * (up? 1 : -1); 
[[self view] setFrame: rect];

[UIView commitAnimations];

// Scroll the active text field into view.
DetailView *tempScrollView = (DetailView *) [self view];
CGRect textFieldRect = [comments frame];
[tempScrollView scrollRectToVisible:textFieldRect animated:YES];    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:26:17+00:00Added an answer on May 15, 2026 at 5:26 pm

    I managed to track it down in the Sim.
    Here it goes:

    • Going to the DetailView
    • Tapping the camera buttom to “open” the UIImagePickerController (camera or Library, does not matter)
    • Now I simulate a memory warning before closing the Picker
    • Choose the image to close the Picker
    • Tap the UITextView

    Under these circumstances the view will receive TWO UIKeyboardWillShowNotification are eachother… so my copied example code for resizing the view is run twise… making it 416px – 216px – 216px = -16px in height… not a good thing.

    The reason for the double notifications were of-course that the ViewController added itself as an observer in viewDidLoad… which runs again when the view “appears” after the memory warning… but the ViewController never removed itself as an observer.

    Doing that fixed the bug for sure:

    - (void)viewDidLoad {
    [super viewDidLoad];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];   
    

    }

    • (void)viewDidUnload {
      [[NSNotificationCenter defaultCenter] removeObserver:self];
      }
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a couple of scripts that I use I have problem that is intermittent.
I am getting an odd intermittent bug that seems to ve related to the
This is a problem I have been trying to track down for a couple
I have an intermittent problem with some code that writes to a Windows Event
I have one of those joyous problems that is intermittent and hard to replicate.
I have a server that's returning an unexpected, intermittent error and wondering if anyone
I have an intermittent linkage error thrown: (That's basically all the information I have)
I have a Windows server that is intermittently losing the ability to lookup DNS
I have a Windows server that is intermittently losing the ability to lookup DNS
I have a .NET client app that intermittently loses connection to a UNC share

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.