Question

This one is a weird one. I have a more complex application that I will not detail here, but one of it's features is that it overlays a translucent black view on top of everything each time a connection is made to the server.

I add that view like this:

MyAppDelegate *appDelegate = (MyAppDelegate *)app.delegate;
[appDelegate.window addSubview:http.progressView.view];

When I run it on the simulator or on device, everything works well: the black screen overlays everything else as expected.

The weird part is this: I archive the application, pack it as an .ipa file and then install it on the phone using itunes (or TestFlight). When I do this, in some places, the black overlay is offseted to the top-right of the screen with about 10 pixels, like the frame.origin.x will be 10 and frame.origin.y will be -10.

Does anybody know what may differ when building the applications as .ipa that makes it behave so differently. I'm afraid of this not happening also when I'll build it for deployment.

Was it helpful?

Solution

The difference is that it'll be built with release settings during archive (e.g. optimisation level s usually, vs optimisation level 0 for debug).

You're not setting the frame of http.progressView.view which is likely causing the problems. Set it to be the applicationFrame of the window's UIScreen:

http.progressView.view.frame = appDelegate.window.screen.applicationFrame;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top