• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
presentingViewController docs patently false
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

presentingViewController docs patently false


  • Subject: presentingViewController docs patently false
  • From: Matt Neuburg <email@hidden>
  • Date: Mon, 19 Dec 2011 15:55:49 -0800

The docs say:

> @property(nonatomic, readonly) UIViewController *presentingViewController
> Discussion
> The default implementation of this property walks up the view hierarchy, starting from this view controller. The first view controller it finds that received the presentViewController:animated:completion: method, or that has its definesPresentationContext property set to YES is returned as the value of the property. It keeps walking up the hierarchy until it finds a value to return or it gets to the root view controller.

Oh, yeah? Watch this:

    self.definesPresentationContext = YES;
    self.parentViewController.definesPresentationContext = YES;
    NSLog(@"%i %i", self.definesPresentationContext,
        self.parentViewController.definesPresentationContext);
    // 1 1
    NSLog(@"%@", self.presentingViewController);
    // null

So both self and its parent do in fact have their definesPresentationContext property set to YES, and yet neither is being returned as the value of the property. I rest my case. Maybe the docs are talking here about some very specific situation where what's claimed is correct, but then they should say what that situation is. I've been looking for it all day and haven't found it... m.

--
matt neuburg, phd = email@hidden, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
Programming iOS 4! http://www.apeth.net/matt/default.html#iosbook
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: presentingViewController docs patently false
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Unknow CF Error
  • Next by Date: Re: presentingViewController docs patently false
  • Previous by thread: Re: providesPresentationContextTransitionStyle busted?
  • Next by thread: Re: presentingViewController docs patently false
  • Index(es):
    • Date
    • Thread