> 
> I wrote a separate app with just one button that brings up a
> UIAlertView.  In the production code I create a UITextField then
> center it in the UIAlertView.
> 

> - (void) willPresentAlertView: (UIAlertView *) alertView
> {
>    CGRect bounds = alertView.bounds;
>    NSLog( @"%f %f", bounds.size.width, bounds.size.height );
> 
>    return;
> }

My two comments would be that 

1) willPresentAlertView: doesn’t make any promises about what state or size the 
UIAlertView is in when that method is called. Perhaps it used to be that the 
bounds were set on them at that point, but I don’t see any way to guarantee you 
can rely on that. One possibility could be that the views used to be sized and 
placed in code and now they are just given to autolayout to deal with, that 
could explain why the size is still zero before the view is presented, probably 
hasn’t been added to the window yet. 

2) "The view hierarchy for this class is private and must not be modified”. In 
the strictest sense adding a UITextField to the UIAlertView is modifying the 
view hierarchy and thus something which you probably shouldn’t be doing. 

So yes iOS8 likely broke something which wasn’t really guaranteed to work, but 
just happened to in previous iOSes. 



_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to