diffrence between [[[[UIApplication sharedApplication] delegate] window] and [[UIApplication sharedA
来源:互联网 发布:windows exe elf 编辑:程序博客网 时间:2024/06/05 12:40
For most uses, they will be the same… but not always.
[UIApplication sharedApplication].keyWindow
is the window which is currently being displayed on the device. This is normally your application's window, but could be a system window.
[UIApplication sharedApplication].delegate.window
is the window your application is expected to use.
Which one should be used? Well that all depends on context.
If you are updating part of your application, then you should add views to your application's window. This is almost always what you want to do.
Personally, I always use [[UIApplication sharedApplication].delegate.window addSubview:view]
or [self.view.window addSubView:view]
(within UIViewController
) when I need to add a view directly to the window.
There might be some times when you want to present a view to the window currently being displayed, regardless if the window belongs to your application or is some system window. I've not run into that situation.
原文 :http://stackoverflow.com/questions/21698482/diffrence-between-uiapplication-sharedapplication-delegate-window-and-u
- diffrence between [[[[UIApplication sharedApplication] delegate] window] and [[UIApplication sharedA
- [UIApplication sharedApplication].delegate.window [UIApplication sharedApplication].keyWindow
- [UIApplication sharedApplication].keyWindow与[UIApplication sharedApplication].delegate.window];;
- [UIApplication sharedApplication].keyWindow和[UIApplication sharedApplication].delegate.window
- ios 尽量用 [UIApplication sharedApplication].delegate.window
- UIApplication sharedApplication的Delegate
- [UIApplication sharedApplication].delegate 调用全局变量
- [UIApplication sharedApplication].delegate 调用全局变量
- UIApplication sharedApplication && UIApplication生命周期
- UIApplication sharedApplication
- UIApplication sharedApplication
- UIApplication sharedApplication
- UIApplication sharedApplication
- UIApplication sharedApplication
- UIApplication sharedApplication
- UIApplication sharedApplication
- [UIApplication sharedApplication]
- 应用程序生命周期(UIApplication sharedApplication)
- (转)python学习笔记——Thread常用方法
- HDOJ 题目2888 Check Corners(二维RMQ)
- HDU-1867-A + B for you again
- 文章标题
- A20平台调试GPS模块
- diffrence between [[[[UIApplication sharedApplication] delegate] window] and [[UIApplication sharedA
- 白雪歌送武判官归京
- LeetCode之Word Break
- shiro使用手册
- 使用Markdown编辑器写博客
- Souvenir
- 凉州馆中与诸判官夜集
- 【转载】MYSQL对时间的处理
- 最长回文子串长度