iOS Question nested push animation can result in corrupted navigation bar

Shay

Well-Known Member
Licensed User
Longtime User
I am going back and forward on 2 pages
and after 2-3 times I am getting these errors and my page is not displaying (only black screen)

this is what I see in logger:
Class (b4i_byhistoryc) instance released.
nested push animation can result in corrupted navigation bar
Class (b4i_httpjob) instance released.
Unbalanced calls to begin/end appearance transitions for Page (vc): Get Client.
Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

What is the problem?
 

Shay

Well-Known Member
Licensed User
Longtime User
This is very problematic, since it losing it's location - meaning buttons are not responding (instance released.)
it will be hard to cut this code and send you, but I think I know how to replicate:
1. create class with few buttons with images
2. call new class with http job
3. on job done, call first class
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
This issue is still open, Erel please replicate (see my first post on how to replicate)
My class is configured as public class on "Main"
So it should be still kept it's reference.

if I put button and make it to move to some class page then it is ok,
the issue is the automatic transfer to different class page after getting response from the http job
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
Issue replicated,
Attached
press "move to page2" then "move to page3", see it is staying on page 3, and you see the errors in the logs.
don't change server name, let it fail
 

Attachments

  • NestedIssue.zip
    8 KB · Views: 194
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I press on the Move to page 3 button. It moves to the next page, shows a short toast message and returns to the previous page. I can then do it again and again.

These are the logs:
Opened Page2
Class (b4i_httpjob) instance released.
Opened Page3
Error response: , status code: 0
Error: The operation couldn’t be completed. (NSURLErrorDomain error -1002.)
Opened Page2
Class (b4i_httpjob) instance released.
Opened Page3
Error response: , status code: 0
Error: The operation couldn’t be completed. (NSURLErrorDomain error -1002.)
Opened Page2
Class (b4i_httpjob) instance released.
Opened Page3
Error response: , status code: 0
Error: The operation couldn’t be completed. (NSURLErrorDomain error -1002.)
Opened Page2
Class (b4i_httpjob) instance released.
Opened Page3
Error response: , status code: 0
Error: The operation couldn’t be completed. (NSURLErrorDomain error -1002.)
Opened Page2
Class (b4i_httpjob) instance released.
Opened Page3
Error response: , status code: 0
Error: The operation couldn’t be completed. (NSURLErrorDomain error -1002.)
Opened Page2
Class (b4i_httpjob) instance released.
Opened Page3
Error response: , status code: 0
Error: The operation couldn’t be completed. (NSURLErrorDomain error -1002.)
Opened Page2
Class (b4i_httpjob) instance released.
Opened Page3
Error response: , status code: 0
Error: The operation couldn’t be completed. (NSURLErrorDomain error -1002.)
Opened Page2
Class (b4i_httpjob) instance released.

Do you see something else?
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
yes I see the nested errors
Can you try IOS 7?
Did you use debug mode?

Copying updated assets files (3)
Application_Start
Application_Active
Opened Page2
Opened Page3
Error response: , status code: 0
Error: unsupported URL
Opened Page2
nested push animation can result in corrupted navigation bar
Class (b4i_httpjob) instance released.
Unbalanced calls to begin/end appearance transitions for Page (vc): Page 2.
Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I now see it too. It only happens on iOS 7. It happens because you remove the current page before it finished the transition animation.

The simplest way to solve it is with a timer that stars the download after 3 seconds:
B4X:
Public Sub Initialize

   If Page1.IsInitialized = False Then
     Page1.Initialize("Page1")
     Page1.RootPanel.LoadLayout("Page3")
     Page1.Title = "Page 2"
     Page1.RootPanel.Color = Colors.RGB (54,54,54)
     Page1.HideBackButton = True ' block button back
     Log("Opened Page3")
   End If
   Main.NavControl.ShowPage(Page1)
   waitForAnimation.Initialize("waitForAnimation", 3000)
   waitForAnimation.Enabled = True
End Sub
Sub waitForAnimation_tick
   waitForAnimation.Enabled = False
   ExecuteRemoteQuery("a=1&b=2" ,"Post1")
End Sub
 
Upvote 0
Top