On Mon, Apr 25, 2011 at 11:04 PM, Heath Borders <heath.bord...@gmail.com> wrote:
> I've seen this behavior also, specifically on iOS 3.1 while using a
> UIViewController inside a UINavigationController inside a
> UITabBarController.
YES - that is nearly my setup (iOS 4.3.2). I don't have the
intermediate UINavigationController, but the view has an
UINavigationBar.

Any ideas on how to locate an arbitrary view controller? The following
only locates the 5 associated with the Tab Bar, and not the top most
PasswordPromptController (which was presented modally).

It sure would have been helpful if viewWillDisappear was sent as
documented. When the home button is pressed, and the home screen is
presented, the view has clearly disappeared (no offense Alex).

Jeff

- (void)applicationWillResignActive:(UIApplication *)application
{
  if(tabBarController.viewControllers != nil)
    [self clearPasswords:tabBarController.viewControllers];
}

- (void)clearPasswords:(NSArray *)viewsControllers
{
  Class passwordPromptClass = [PasswordPromptController class];

  for (UIViewController * viewController in viewsControllers)
  {
    if ([viewController isKindOfClass:passwordPromptClass])
      [(PasswordPromptController *)viewController clearPassworAndPin];
  }
}

>
> On Mon, Apr 25, 2011 at 9:59 PM, Jeffrey Walton <noloa...@gmail.com> wrote:
>> Hi All,
>>
>> According to the documentation in the headers:
>>
>>    // UIViewController.h
>>    // Called when the view is dismissed, covered or otherwise hidden.
>>    - (void)viewWillDisappear:(BOOL)animated;
>>
>> And Apple's documentation [1]:
>>
>>    Notifies the view controller that its view is about to be dismissed,
>>    covered, or otherwise hidden from view.
>>
>> I'm not sure if I should be surprised or not, but viewWillDisappear
>> does not appear to be called despite what the documentation claims.
>>
>> The view is part of a custom view controller (built with IB - nothing
>> fancy) and presented modally. To duplicate, show a view modally and
>> press the home button.
>>
>> Thanks in advance,
>> Jeff
>>
>> [1] 
>> http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html
>> [SNIP]
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to