Posts

Post not yet marked as solved
2 Replies
Thank you for your reply. But I don't understand your question of this part: "show code where you expect it to be called" This is UITableView protocol, which means, UITableView calls this in order to create the contents when it is needed. The inside the method will be either: switch(section){ case 0: ( something ) break; default: ( something ) break; or if(section == 0){ ( something ) } else if (section == 2){ ( something ) } else{ ( something ) } so that I can set different values wherever I need and returns it. The problem I'm pointing here is, UITableView doesn't call this method to find the value for section '0' while it does call this for other sections. By the way, I also found another weird behavior on this method. When I set a large number for the returning value, the title of associated section will no longer appear at the bottom. It moves up along with the value getting bigger. I believe this is a bug unless Apple changed it to this "new manner" intentionally.
Post not yet marked as solved
2 Replies
Thank you very much for the reply although it was a very bad news for me.... Just to let you know, I learned this Modal structure 10 years ago and has been used in my app since then. It's been working just fine until I discovered this. So sad to know it was an "illegal" technique....
Post not yet marked as solved
2 Replies
Thank you Xuelunw for your answer. Yes, you're right. I found UIScreen shouldn't be used for this purpose as I asked this to Apple Developer Technical Support and gotten the answer. Here is what it is explained: As your app supports resizing, using the UIScreen values for layout calculations won’t work. UIScreen returns you information about the hardware display. On an iOS device before multi-tasking, these values could be a proxy for the available space to layout your interface, but with iOS multi-tasking, your app might only be allocated a fraction of that space, so the values returned from UIScreen ceased to be useful for layout purposes at that point. On macOS, that continues to be true — UIScreen is returning you information about the hardware display, which now might be as large as a desktop display, and your window can be placed at any size and at any position on the screen. Rather than using UIScreen for layout calculations, you should look for something more local to use for the layout calculations. This might be information in a view controller, a specific view, a scene, or a window. .... so, I changed it to the local value, then it works as expected now.