I have an app with UINavigationController. There is ADBannerView on the root view of the navigation controller.
Should I somehow stop recieving ads when I go to another views (and rootView disappears from screen)?
I haven't found some special discussion of this topic on Internet. There is no info about it in iAd Programming Guide. And, according to my own tests (simple breakpoints to delegate methods) - ADBannerView recieves Ads (or process them with delegate methods) only when parent view controller is active.
That's why I suppose the answer to my question is "nothing". I should only correctly place ADBannerView and implement delegate methods.
There is always the 30 seconds rule, where ad display only count when you show a Ad for more then 30 seconds. This would mean if your user navigate to another view the ad that was displayed on your root doesn't count.
I'm currently trying to figure out how you can display the iAd banner outside the UINavigationController so that the iAd banner remains in view and the change that you hit that 30 seconds increases.
Related
In my JavaFX application, at a specific page I have to initialize (when loading the page) some devices such as iris scanner, fingerprint scanner, cameras etc. Before leaving the page/controller it is necessary to deinitialize the devices. There are two buttons in that page. If the user leaves this page by clicking one of these two buttons I can easily deinitialize them. But if the user leaves the page by clicking any menu/sub menu (there are more than 30 menu and sub menu in this application), how can I deinitialize these devices?
There is no destructor in java and I also tried using finalize but nothing comes out.
You cannot rely only on the finalize() method. An answer to this request seems to show that this method is used by the garbage collector to check data loss references. So you need to destroy objects by-hand in a custom method, then finalize() will be automatically applied.
You must create a deinitialize() method (public or package-private, depends on the location of your MenuBar controller) then call it inside your sub-menu item.
I have 1 (rootViewController) view controller which is embedded in navigation controller. Then i pushed another view controller (secondViewController), which has search controller in title view. When i am trying search become first responder (Active) i got this in terminal:
Warning: Attempt to present
"AppName.CustomSearchViewController: 0x7face0c20eb0> on
whose view is
not in the window hierarchy!
This happens only in iOS lower than 11. When i embed this second view controller in navigation controller and present it modally all works good, but i need exactly pushing. How can i solve this?
I solved it! I need to make definesPresentationContext false in rootViewController to make it work on another one!
I have added an iAd banner view to my project and pinned it to the top of the main view controller in a storyboard. Initially when the app loads the iAd banner is displayed at the bottom of the screen. The banner is then hidden during a game and then unhidden at the end of the game. When the banner is unhidden it appears correctly as designed in the storyboard at the top of the view. Any thoughts why this is happening? This occurs on both the simulator and real devices.
You've created two ADBannerView's in your application. Once with self.canDisplayBannerAds = true and once programmatically.
self.canDisplayBannerAds = true can be used for a no hassle way of implementing iAds in your application. This will create an ADBannerView for you and show or hide the ADBannerView depending on whether it receives an ad or not from the iAd network. The ADBannerView you're seeing at the bottom of your screen is created by self.canDisplayBannerAds = true. The ADBannerView you're seeing at the top of your screen is the ADBannerView you have created.
Remove self.canDisplayBannerAds = true from your viewDidLoad function.
I am trying to figure out ways to authenticate a user and load the application (while showing a preloader) in Adobe Air [desktop application, and not web based flex app].
This is what I have been able to achieve so far:- A window asks for login details, once validated I make the login window invisible and open an instance of the application's main window. There are 2 problems with this:-
I have to open a new window (2 windows in total). It would rather look better if I was able to simply show the login form in one state and the main application view in another state. I tried that too, but the problem is that besides the view component, flash does execute all the actionscript and keeps the other state ready. There is some application view centric actionscript which starts throwing null reference errors etc. On top of that, the whole things takes a while to show up as both views are created, though only 1 of them is shown
I'd like to show a preloader once the user is authenticated, until the main application view is loaded
In a nutshell, this is what I am trying to do:-
Load the login window as fast as possible and stop there (actionscript in other parts of the application should not run)
Post authentication, load the main view of the application. Show a preloader until the loading is done
Load the main view in the same window (rather than opening a new window and making the login one invisible)
Need help and direction as to how this could be executed.
Thanks!
UPDATE 1
Ok, so now I've managed to consolidate the functionality in a single window. however, the transition between states is not a smooth one.
State 1 is the login screen. If the user enters the correct login credentials, State 2 of the view becomes active.
Now for State 2 to load (its a bunch of UI components and a grid with loads of data) it takes time. Until then, the application blanks out and then all of it is shown in a jerk. Can the transition be made much smoother? Just showing 'Loading...' would suffice. Because State 2 won't show up until all of it has been constructed and State 1 dies away as soon as I change the current state to State 2. Is there any way to monitor the progress and changing the state only when the next state has been loaded!
UPDATE 2
Ok, I got the transition animation to work between states. However, there still exists a problem with the transition switch. The problem is that the state I switch to after login has been verified has a lot of components and shows a lot of data.
Is there a way I can attach Listeners (if any), which I can fire when the state loading is complete and view has been generated! The current jerk like effect in the transition is because the state has changed but the view has not completed yet.
State Change to State 2 is not smooth as State 2 loads about 10000 rows of data from database. Is there a way I can change the state visibly for the user, after state 2 has been completely drawn out and has pulled in all data? creationComplete doesn't help much here.
In short, is there a way to start loading a state from an initial state and make it visible only when its complete loaded? i.e. can I fire an event from state 1 to load state 2, but to visibly transition to state 2 only when state 2 is completely loaded..
UPDATE 3
After a week of firefighting, posting a bounty and scavenging through the web I have still not been able to fix this! My application window becomes unresponsive for the time the UI is created and data is loaded. In Windows, it even shows 'Not Responding' at the window title bar for about 5 seconds. So its the UI getting stuck because the data is taking some time to be fetched and loaded - all of this happens in a single thread by default.
How do people who develop based on Adobe Air do this? I've mostly always seen a loading screen before the actual game is loaded - and when its loaded, its fully functional. There has to be a way!
The time consuming problem of loading 10000 rows in a grid can come in any web based language in any web application because web application needs to run in the environment of a web browser which has its own resource limitation.
So what I would suggest is that you don't load all 10000 records at loading the view. Instead load 1000 records first and then keep a link or button with label "Next" or "Show More" like and on that click bring the next bunch of 1000 records from the database. This way you can accomplish your task.
Thanks,
Jigar Oza
I have a very simple Flex application for mobile phones which uses 3 tabs (with the TabbedViewNavigatorApplication).
It seems that everytime I switch tabs, the selected view is reloaded.
I've set a creationComplete command to do something and everytime I click on the tab it executes the function.
Isn't it possible for the views to get loaded 1 time and that's it?
Seems to me that this behaviour is exactly the point on mobile devices since you want to keep memory / cpu usage as low as possible.
This effectively means destroying all non-active views and all related view components / objects.
However you can override this default behaviour by setting the destructionPolicy on every view to destructionPolicy="never".
This blog post will explain the basic understanding you will need to obtain.
Cheers