I have a "Back" button that I created.
Action for it is ----- UIAplication.getUIApllication.pushScreen(screen1)
I did so because I want to refresh screen 1 when I cick "Back ".
But there have an error that " OutOfMemoryError" when I click "Back" few times.
If I replace with - UIAplication.getUIApllication.popScreen(this) , there have no error .
But I really want to refresh screen1.
Why I gotthis error ? How to solve it ? ( I use Persistenobject to save data for my app ).
Please help me . Thanks a lot.
Pushing the same screen again adds additional screen to stack and takes additional memory.
And it is logical that you get outofmemory error.
If you want to refresh field's/manager's contents use invalidate() method of a particular field or manager.
You can try popping the old screen1 and then pushing it again:
UIAplication.getUIApllication.popScreen(getScreenBelow());
UIAplication.getUIApllication.pushScreen(new screen1());
Related
I used react navigation 4.0.10 and it's little bit complicated app with nested navigator. Currently it's performing relatively well except that When I try to navigate it very fast, it will crash. The error message is
TypeError: undefined is not an object (evaluating 'navigation.state')
The structure is
-bottomTapNavigator(Home, Scan; Scan is a stackNavigator)
--HomeScreen
--ScanNavigator(stackNavigator, parent for ScanScreen and JourneyNavigator[tabNavigator])
---ScanScreen(Real page, initial screen of ScanNavigator, having buttons to navigate(HomeScreen) and navigate(JourneyNavigator))
---JourneyNavigator(TabNavigator, including ScreenTest1 and ScreenTest2; having header with back button navigate(ScanScreen) for both ScreenTest1 and ScreenTest2;)
---ScreenTest1(Real page)
---ScreenTest2(Real page, does not matter in this case)
what I do is tap ScanNavigator[ScanScreen]->ScreenTest1->ScanScreen(tap navigation button quickly here)->HomeScreen
In such case, the app will crash. If i do it with normal pace then it's fine.
Any help or direction is welcome.
EDIT
I'm 100 percent certain it's something to do with resetOnBlur setting. When it set to false, the issue gone. Help please.
I build chat app using Firebase API right now. I wan't to make preload icons like on facebook screenshot. I thought i can create empty images and label fields and fill them after content loaded, but i don't know how to check if all data loaded from DB. How i can do that in correct way?
This is where i want to place objects
Install ListPlaceholder this lib.
import ListPlaceholder
To show the loader, start showing this from start
tableView.showLoader()
To hide the loader, end showing after data has been loaded
tableView.hideLoader()
Please refer this may get help.
https://github.com/malkouz/ListPlaceholder
Facebook has it's own library called Shimmer. To use this on tableview, you can follow this StackOverflow question answer.
You'll just have to create the UIView you want to animate and above that you'll have to add your FBShimmeringView. At the end set shimmeringView.shimmering = true to start shimmering
To hide the loading use tableView.hideLoader()
ListPlaceholder helped me to resolve the issue. All that I did was added the ListLoader.swift file to my project and added tableView.reloadData(), tableView.showLoader() in viewDidAppear in the tableView where I wanted to show loading.
( ListLoader.swif uses visibleCells to determine the number of rows on which the loading should be shown. In my applications, visibleCell's count was incorrect on calling tableView.showLoader() method in viewDidLoad )
I have a problem with an app I am developing. In one of the controllers, whenever I try to press a button that performs a segue the app crashes (if it's programmatically added with "has no segue with identifier 'showBlog'" error) or just doesn't work (when it's a cntrl + drag added segue with "Terminated due to signal 9" error). I have double checked and the segue identifiers are correctly added. They where corking previously and now they stopped. I have already closed Xcode and restarted the computer, also cleaned and rebuild the app.
What have I changed since last time it worked?
I added an alert when the user presses another button (that it's working correctly) also, I tried to copy a button (cntrl + c) but by mistake I made the copy selecting the full view controller and when I made the paste (cntrl + v) nothing happened that I can see, but I guess that might be the problem. But I can't find any view controller to erase. Any ideas on how to correct this? Thanks
Delete the view and the controller make a new one and try it.. it's a glitch sometimes in the Xcode..
Let me know if it works thanks :)
When I go to type a message into my JSQMessagesViewController, the view is not being pushed up when the keyboard appears.
I can't send a message and I can't see the message I'm typing.
I don't even see any code in my VC that would be causing this / that would have changed this so I don't know where to start looking or what code to supply. I've downloaded examples using JSQMessages and I feel like this is just built in functionality behind the scenes.
Any ideas?
If you have viewDidAppear/viewDidDissapear being used you have to use
super.viewDidAppear(true)
and
super.viewDidDissapear(true)
also called respectively.
Adding those in fixed the issue.
My application start with navigation Controller based, then change to Tabbar base after user login. If the second tab is selected, then it will presentModalViewController. In this viewController, I load a webview as normal I do. But the problem is for first time I do presentModalViewController, then I get the warning message above and it likes un-responded for few seconds before presentModalViewController (webpage is still loaded fully-no crashed). After the first time, it's normal (no warning message-very smooth).
I tried to take out the webview, I do presentModalViewController with a image instead. It's okay(no warning message). However, If i drag Uiwebview in IB into my viewcontroller only without any connecting with IBoutlets. I still get that warning message.
I did a lot of researches like this, I tried to load the Url request in both ViewDidLoad and ViewWillAppear, but it didn't help
My question is how can I pass by the warning? and is it okay to ignore this warning since this is my first time getting this warning?
Please help! Thank you very much.
Try -viewDidAppear:
This seems to happen when multiple animations conflict.
I just ignore the warning. It will not cause any crashes
.