Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in new keywindow (custom alertsheet) #25

Closed
leafc opened this issue Feb 12, 2014 · 2 comments
Closed

bug in new keywindow (custom alertsheet) #25

leafc opened this issue Feb 12, 2014 · 2 comments
Assignees
Labels

Comments

@leafc
Copy link

leafc commented Feb 12, 2014

When have a new window like custom alertsheet it will some bug
rootViewController and keyWindow should be weak not strong
otherwise keyWindow cannot be release

当有一个新的Window的时候比如自定义带输入框的弹出框,就会有BUG,输入框高度不变,底下的View却被提上去了,另外如果属性不改成weak会造成退出alertView后界面点击不了,无法进行任何操作,因为弹出框的Window不能释放。

@Property(nonatomic, weak, readonly) UIViewController *rootViewController;
@Property(nonatomic, weak, readonly) UIWindow *keyWindow;

-(UIViewController *)rootViewController
{
// if (_rootViewController == nil)
_rootViewController = [[self keyWindow] rootViewController];
return _rootViewController;
}

-(UIWindow *)keyWindow
{
// if (_keyWindow == nil)
_keyWindow = [[UIApplication sharedApplication] keyWindow];
return _keyWindow;
}

this code work for me.
我改成上面的代码后就成功了,不过没有测试对其它功能的影响。理论上没有什么副作用。

@hackiftekhar
Copy link
Owner

Can you provide me sample app which demonstrate this issue. So I will be able to understand what exactly the issue was and able to solve it universally.

@hackiftekhar
Copy link
Owner

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants