Skip to content

Instantly share code, notes, and snippets.

@rzaitov
rzaitov / gist:9002349
Created February 14, 2014 14:53
no way to remove ugly alert
public WebAuthenticatorController (WebAuthenticator authenticator)
{
this.authenticator = authenticator;
authenticator.Error += new EventHandler<AuthenticatorErrorEventArgs> (this.HandleError);
authenticator.BrowsingCompleted += new EventHandler (this.HandleBrowsingCompleted);
bla bla bla
}
Xamarin Studio
Version 5.1.1 (build 0)
Installation UUID: aa8ee8fb-8a7e-4802-bd37-2b7fc60f18f4
Runtime:
Mono 3.4.0 ((no/c3fc3ba)
GTK+ 2.24.23 (Raleigh theme)
Package version: 304000204
Xamarin.Android
INFO [2014-06-19 15:04:05Z]: Starting Xamarin Studio 5.1.1 (build 0)
INFO [2014-06-19 15:04:05Z]: Running on Mono 3.4.0 ((no/c3fc3ba)
WARNING [2014-06-19 15:04:05Z]: Gtk-Warning: Locale not supported by C library.
Using the fallback 'C' locale.
Stack trace:
at Gtk.Application.gtk_init(Int32 ByRef , IntPtr ByRef )
at Gtk.Application.do_init(System.String progname, System.String[] ByRef args, Boolean check) in /Volumes/build-root-ramdisk/gtk-sharp-2.12.21/gtk/Application.cs:line 101
at Gtk.Application.Init(System.String progname, System.String[] ByRef args) in /Volumes/build-root-ramdisk/gtk-sharp-2.12.21/gtk/Application.cs:line 122
at MonoDevelop.Ide.IdeStartup.Run(MonoDevelop.Ide.MonoDevelopOptions options) in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.1.1-branch/00346606/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:line 103
at MonoDevelop.Ide.IdeStartup.Main(System.String[] args, MonoDevelop.Ide.Extensions.IdeCustomizer customizer) in /Users/bu
class MyController : UIViewController
{
AVCaptureFileOutput _fileOutput;
void DoStuff()
{
_file.StartRecordingToOutputFile(someUrl, this); // now this is imposible
}
[Export ("captureOutput:didStartRecordingToOutputFileAtURL:fromConnections:")]
public enum AVCaptureFocusMode
{
ModeLocked, // "Mode" prefix?
ModeAutoFocus, // "Mode" prefix?
ModeContinuousAutoFocus // "Mode" prefix?
}
public enum AVCaptureFlashMode
{
Off,
@rzaitov
rzaitov / gist:bfb3c273e4e6e2c8bc64
Last active August 29, 2015 14:03
Dependent key
public partial class MyController : UIViewController
{
private bool deviceAuthorized {
[Export("isDeviceAuthorized")]
get;
[Export("setDeviceAuthorized:")]
set;
}
private bool sessionRunningAndDeviceAuthorized {
System.MemberAccessException: Cannot create an instance of MonoTouch.AddressBook.ABRecord because it is an abstract class
at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007f] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:525
at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:556
at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62
at MonoTouch.ObjCRuntime.Runtime.ConstructINativeObject[INativeObject] (IntPtr ptr, Boolean owns, System.Type type, MissingCtorResolution missingCtorResolution)
@rzaitov
rzaitov / gist:0ddfe593ec870db70762
Created July 1, 2014 20:16
[AVFoundation] AVTimedAnnotationWriter: Using Custom Annotation Metadata for Movie Writing and Playback
1. remove provisioning profile (set Automatic)
2. support only landscape
3. annotation doesn't export
4. crash on chancgeAnnotation method
5. enhacement – UITapGestureRecognizer (this, new Selector ("changeAnnotationColor")) use overload with Action
public class MyController : UIViewController, IAVCaptureFileOutputRecordingDelegate
{
private AVCaptureMovieFileOutput _movieFileOutput;
private NSUrl _outputUrl;
public void DoWork()
{
// follow doesn't work.
// Because there is no overload StartRecordingToOutputFile (NSUrl, IAVCaptureFileOutputRecordingDelegate)
_movieFileOutput.StartRecordingToOutputFile(_outputUrl, this);
1. [JournalViewController.cs]
NSNotificationCenter.DefaultCenter.AddObserver (this, new Selector ("updateJournal"), UIApplication.DidBecomeActiveNotification, null);
//Should replace with:
UIApplication.Notifications.ObserveDidBecomeActive (handler);
2. [JournalViewController.cs]
var components = new NSDateComponents ();
components.Day = calendar.GetComponentFromDate (NSCalendarUnit.Day, now);
components.Month = calendar.GetComponentFromDate (NSCalendarUnit.Month, now);
components.Year = calendar.GetComponentFromDate (NSCalendarUnit.Year, now);