开发者

Could UINavigationControllerWillShowViewControllerNotification get my app rejected?

开发者 https://www.devze.com 2022-12-28 15:17 出处:网络
I\'m observing UINavigationControllerWillShowViewControllerNotification on UINavigationController to keep track when the current view controller has been popped, as suggested on this post.

I'm observing UINavigationControllerWillShowViewControllerNotification on UINavigationController to keep track when the current view controller has been popped, as suggested on this post.

There's literally no reference anywhere for that notification and a Google search will link me only to that post.

Does it mean this is a private notification and my app could be rejected?

Even worse: does it mean I shouldn't trust how that notification works as it might break 开发者_如何转开发in a future SDK version?


The notification in question is actually implicitly referenced in the documentation:

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated

Delegate methods are, at least in Cocoa for Mac OS X usually accompanied by a notification (well, often times, anyway).

As it stands it's an undocumented feature, and as such should be treated with care. If possible, use the delegate method instead.

However: If it appears in the header, and it works, and it is accompanied with a delegate method; it is possible that this is a documentation oversight on Apple's side; and that using it is safe.

I recommend filing a bug and see where that gets you; at least if restructuring your application to use a delegate directly would be overly cumbersome (more cumbersome than filing a bug).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号