Cancel Button in SearchBar Causing app to crash (Xamarin Forms) - xamarin.forms

When I run the app the rest of the search bar is working properly, however, when I press the cancel button on the search bar it crashes the program with the error
{System.NullReferenceException: Object reference not set to an instance of an object
at App.SearchPage+<>c__DisplayClass4_0.<SearchBar_TextChanged>b__0 (System.String Name) [0x00000] in /Users}
This problem is only happening on the IOS app since the Android app does not include the cancel button.

Related

Data binding not working on iOS device xamarin forms

I am updating a Xamarin App it is working perfectly on Android devices, Android Simulator, and iOS simulator but Not working on iOS devices. I want to test it on the device before launching a new release on Appstore.
I am able to deploy on iOS devices.
The first issue I was facing was in NLogger returning System.NullReferenceException: 'Object reference not set to an instance of an object'
For Logging, I am following
https://martynnw.wordpress.com/2016/10/16/logging-with-nlog-in-xamarin-forms/
tried a lot to resolve the issue did not succeed. so I commented NLogger for Now and used Console.WriteLine("Error: " + ex.Message); just to track/see errors. Here I have raised a question about the NLogger issue.
https://stackoverflow.com/q/71025867/8287839
After commenting NLogger App worked it opened the landing (login) page. But data binding is not working whatever I am filling in the fields it's not being set to the model all parameters are empty. Image paths are Null, Constant variables are null.
On the simulator data binding is working.
How can I resolve this? Do I need to change some kind of permissions or generate a certificate on developer.apple.com?
Here I have uploaded ViewModel, controller, view files.
https://github.com/omshergill/MobileApp

CrossFirebasePushNotification.Current.RegisterForPushNotifications(); throwing NullReference iOS

to do push notifications in my Xamarin Forms App, I am using the CrossGeeks FirebasePushNotification Plugin. My android setup is working alright, but for the iOS app, when I try to run the app, the line
CrossFirebasePushNotification.Current.RegisterForPushNotifications();
is causing a NullReference Exception. What I have done to set up:
Set "FirebaseAppDelegateProxyEnabled" to "No"
Changed the GoogleService plist to Bundle Resource
Added the FirebasePushNotificationManager.Initialize(options, true); in the App Delegate (and it is saying it is unreachable?"
I am testing on a simulator but I believe this should only prevent the receiving of notifications, not the registering?
How would I solve this problem? In the documentation, it states that these are the steps needed for iOS setup.

UISplitViewController calling viewWillDisappear(_:) before the view is loaded at launch on iOS 11.2

I have an app with a UISplitViewController as the initial controller, and it has both a master and a detail view controller (embedded in UINavigationControllers) as its child view controllers, laid out in Interface Builder. The split view controller's preferredDisplayMode is set to .primaryHidden.
I just upgraded to Xcode 9.2, which uses iOS 11.2 in the simulator. When I launch the app on an iPhone, either a device or simulator, I see a new behavior at launch: viewWillDisappear(_:) is called BEFORE viewDidLoad() on the detail view controller. At this point the detail view controller is not yet loaded - all of its IBOutlets are nil. After that call, the system loads the view and calls viewDidLoad() as usual.
I discovered this because that viewWillDisappear(_:) method accessed a UITextField to check if it was the first responder. In the code below, textfield is connected to a UITextField via IBOutlet:
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
if textfield.isFirstResponder {
textfield.resignFirstResponder()
}
}
Since the view wasn't yet loaded, textfield was nil and the app crashed. This was easy to fix by adding a test for nil. But in earlier versions of Xcode and iOS, the crash didn't occur because, I assume, viewWillDisappear(_:) was not called before the view was loaded.
Also interestingly, this doesn't occur with Xcode 9.2 running iOS 11.2 on an iPad, either device or simulator. On an iPad, viewWillDisappear(_:) is not called at launch on the detail view controller.
This seems like a bug: why should viewWillDisappear(_:) be called on the detail view controller (or on any view controller) before the view is actually loaded at launch. Is anyone else is seeing this behavior with UISplitViewController on an iPhone running iOS 11.2? Or is it the consequence of something I've overlooked, even though the app worked without issues in earlier versions?

AirPlay button a la phone app on WatchKit?

The phone app in watchOS shows an AirPlay icon which when clicked switches the audio input and output to the watch itself, using it as it were a bluetooth headset, I guess.
I'd like to do the same for a calling app I work on, but couldn't find anything in the WatchKit documentation.
Is this not available as a public API? AFAIS there doesn't seem to be an equivalent for MPVolumeView on watchOS: http://www.openradar.me/20783803
Any ideas?

AIR - Different behaviour when the app is installed and when it runs inside the builder

we are developing an Adobe AIR app using Flex4. We are facing lot of bugs that didn't show up when we run the application inside Flash Builder (both debug mode and run mode), but when we install the app and run it, the app shows a different behaviour. Any idea ? what does it change between running the installed application in the builder and outside ?
Thanks a lot
Ok i've founded the problem using MonsterDebugger in the application running stand alone. The problem was the File.browseForDirectory(). I'm creating the File object, registering the event listener and then calling File.browseForDirectory() and that generate an exception. I switched the order, First creating a new file, then calling File.browseForDirectory() and at last register an event handler and works great.
My guess is that inside the debugger version and inside Flash Builder it takes just few more millisec and the File object is ready when i register the eventlistener but in the stand alone application AS3 code for event listener registration is executed before the File object initialization.

Resources