Quantcast
Channel: Xamarin.Mac — Xamarin Community Forums
Viewing all 1429 articles
Browse latest View live

Process.Start create an instance of the app instead of running a process

$
0
0

i run the following code and instead of running the package exe (just some command line stuff wrote in .NET) i notice another instance of the existing app
does anyone had this and know how to solve it?

BTW, i printed out the package exe path and it looks OK but still there's a process with the same app name instead of the exec

   if (string.IsNullOrEmpty(package_exe_path))
            return true;

   Console.WriteLine(package_exe_path);

        var psi = new ProcessStartInfo
        {
            FileName = package_exe_path,
            Arguments = arguments,
            UseShellExecute = false,
            CreateNoWindow = true,
            ErrorDialog = false
        };

        try
        {
            var p = Process.Start(psi);

            if (p == null)  
            {

                return false;
            }
        }

XIB File to Windows Project.

$
0
0

Hi,

We currently have an IOS and Xamarin.MAC shared code application based on Xamarin.IOS and Xamarin.MAC.

it works very well.

We would like to port the application on Windows. Is there a tool for transforming XIB Files into WinForms (WPF, XAML, ...)?

Where to do that, should I redo as I did for Xamarin.MAC all screens in a Windows project?

Thanks for your help.

Alain

BadImageFormatException for System.ServiceModel.Web.dll

$
0
0

Hi All,
I'm running into a few exceptions related to System.ServiceModel.Web. According to the documentation, this is an available assembly, but I get errors whenever I try to work with it from my Xamarin.Mac app.

Simply running this code:

            var Data = System.IO.File.ReadAllBytes(@"/Library/Frameworks/Mono.framework/Versions/5.8.0/lib/mono/4.6.1-api/System.ServiceModel.Web.dll");

            System.Reflection.Assembly.Load(Data);

Generates the exception.

Does anyone have any suggestions? Perhaps something is messed up with this assembly?

Collection view tutorial issue

$
0
0

Hello,

I was working through this tutorial https://developer.xamarin.com/guides/mac/user-interface/working-with-collection-views and was unable to get it to work. I was getting the following runtime error: "-[NSNib _initWithNibNamed:bundle:options:] could not load the nibName: EmployeeItemController in bundle (null)."

I got it working eventually, and I believe the problem was the following part of the instructions. In "Creating the Cell Prototype" we are directed to create a new ViewController with the name EmployeeItem, and we're told that "This will add an EmployeeItem.cs, EmployeeItemController.cs and EmployeeItemController.xib file to the project's solution." That is not true: what you get are the three files EmployeeItem.cs, EmployeeItemController.cs and, crucially, EmployeeItem.xib. You must manually rename the .xib file to be EmployeeItemController.xib.

Hopefully this helps others.

Attach NSTableCellView to TableColumn programmatically

$
0
0

Hi there, I'm an experienced c# developer porting an app to the Mac/iOS although I'm very new to writing anything for an Apple environment so it's a massive learning curve finding out how it all hangs together. I have successfully used the storyboard to get a TableView populated with my data and displaying. However I've got about 20-30 of these tableview to add and it seemed pointless to manually configure them all when they are all the same general idea just different interfaces describing the display fields from different classes.

So instead of using storyboards I want to create my viewcontroller/tablesource programatically and once it's working for a test case I can eventually move on to using a generic class to create a controller/tablesource. NB. I'm using a tablesource in order to make the code differences between a MacOS version and an iOS version minimal.

My issue is that when I create a table column it's not got a TableCellView and try as I might I cannot find a way of programmatically adding an NSTableCellView (standard or customised) to my columns. Here is my code.

ViewController:

using System;
using Foundation;
using AppKit;
using FTAnalyzer.Mac.DataSources;
using System.Reflection;

namespace FTAnalyzer.Mac
{
    public partial class IndividualsViewController : NSViewController
    {
        FamilyTree _familyTree;
        NSTableView _individualsTableView;

        public IndividualsViewController(IntPtr handle) : base(handle)
        {
            _familyTree = FamilyTree.Instance;
        }

        public void ResetDocument()
        {
            if (!NSThread.IsMain)
            {
                InvokeOnMainThread(() => ResetDocument());
                return;
            }

            _individualsTableView = new NSTableView()
            {
                RowSizeStyle = NSTableViewRowSizeStyle.Default,
                Enabled = true,
                UsesAlternatingRowBackgroundColors = true,
                ColumnAutoresizingStyle = NSTableViewColumnAutoresizingStyle.Sequential,
                Source = new IndividualsTableSource()
            };

            PropertyInfo[] properties = typeof(IDisplayIndividual).GetProperties();
            foreach (PropertyInfo property in properties)
            {
                var tableColumn = new NSTableColumn()
                {
                    Identifier = property.Name,
                    Width = 100,
                    Editable = false,
                    Hidden = false,
                    Title = property.Name
                };
                _individualsTableView.AddColumn(tableColumn);
            }
        }

        public override void LoadView()
        {
            base.LoadView();

            ResetDocument();
            _individualsTableView.ReloadData();

            var scrollView = new NSScrollView()
            {
                DocumentView = _individualsTableView
            };
            View = scrollView;
        }
    }
}

TableSource:

using System;
using Foundation;
using AppKit;
using FTAnalyzer.Mac.DataSources;
using System.Reflection;

namespace FTAnalyzer.Mac
{
    public partial class IndividualsViewController : NSViewController
    {
        FamilyTree _familyTree;
        NSTableView _individualsTableView;

        public IndividualsViewController(IntPtr handle) : base(handle)
        {
            _familyTree = FamilyTree.Instance;
        }

        public void ResetDocument()
        {
            if (!NSThread.IsMain)
            {
                InvokeOnMainThread(() => ResetDocument());
                return;
            }

            _individualsTableView = new NSTableView()
            {
                RowSizeStyle = NSTableViewRowSizeStyle.Default,
                Enabled = true,
                UsesAlternatingRowBackgroundColors = true,
                ColumnAutoresizingStyle = NSTableViewColumnAutoresizingStyle.Sequential,
                Source = new IndividualsTableSource()
            };

            PropertyInfo[] properties = typeof(IDisplayIndividual).GetProperties();
            foreach (PropertyInfo property in properties)
            {
                var tableColumn = new NSTableColumn()
                {
                    Identifier = property.Name,
                    Width = 100,
                    Editable = false,
                    Hidden = false,
                    Title = property.Name
                };
                _individualsTableView.AddColumn(tableColumn);
            }
        }

        public override void LoadView()
        {
            base.LoadView();

            ResetDocument();
            _individualsTableView.ReloadData();

            var scrollView = new NSScrollView()
            {
                DocumentView = _individualsTableView
            };
            View = scrollView;
        }
    }
}

Symbolicating crash reports

$
0
0

I think this has more to do with Mono, but I'll still ask. How does Mono/Xamarin symbolicate its crash reports?

With PLCrashReporter I get something like this:

Incident Identifier: AD86F93B-4DC2-464E-861B-401AD0B2B2A6
CrashReporter Key:   TODO
Hardware Model:      MacBookPro13,3
Process:         RemoteDesktopMan [20934]
Path:            /Users/Devolutions33/workspace/RDMOXv3/Mac/RemoteDesktopManager/Clients/RemoteDesktopManager/bin/Debug/RemoteDesktopManager.app/Contents/MacOS/RemoteDesktopManager
Identifier:      com.devolutions.remotedesktopmanager
Version:         5.1.0.0
Code Type:       X86-64
Parent Process:  launchd [1]

Date/Time:       2018-03-02 16:34:29 +0000
OS Version:      Mac OS X 10.13.4 (17E139j)
Report Version:  104

Exception Type:  SIGSEGV
Exception Codes: SEGV_NOOP at 0x114314d40
Crashed Thread:  0

Thread 0 Crashed:
0   libsystem_kernel.dylib              0x00007fff7870cafe 0x7fff786f0000 + 117502
1   libsystem_c.dylib                   0x00007fff7861a6fe 0x7fff7860b000 + 63230
2   ???                                 0x00000001333436c4 0x0 + 0
3   RemoteDesktopManager                0x000000010dad0548 0x10d9a3000 + 1234248
4   RemoteDesktopManager                0x000000010db9b2c8 0x10d9a3000 + 2065096
5   RemoteDesktopManager                0x000000010db9b240 0x10d9a3000 + 2064960
6   RemoteDesktopManager                0x000000010d9d6fcc 0x10d9a3000 + 212940
7   RemoteDesktopManager                0x000000010d9d7e3d 0x10d9a3000 + 216637
8   RemoteDesktopManager                0x000000010d9d92d1 0x10d9a3000 + 221905
9   AppKit                              0x00007fff4ddde516 0x7fff4d604000 + 8234262
10  AppKit                              0x00007fff4d884083 0x7fff4d604000 + 2621571
11  AppKit                              0x00007fff4d883fab 0x7fff4d604000 + 2621355
12  AppKit                              0x00007fff4d883eb1 0x7fff4d604000 + 2621105
13  AppKit                              0x00007fff4d8c5168 0x7fff4d604000 + 2888040
14  AppKit                              0x00007fff4d88271a 0x7fff4d604000 + 2615066
15  AppKit                              0x00007fff4d8c4eaf 0x7fff4d604000 + 2887343
16  AppKit                              0x00007fff4d8811b4 0x7fff4d604000 + 2609588
17  AppKit                              0x00007fff4df7d715 0x7fff4d604000 + 9934613
18  AppKit                              0x00007fff4df7a36c 0x7fff4d604000 + 9921388
19  AppKit                              0x00007fff4df79618 0x7fff4d604000 + 9917976
20  AppKit                              0x00007fff4ddda3d3 0x7fff4d604000 + 8217555
21  AppKit                              0x00007fff4d63b4ed 0x7fff4d604000 + 226541
22  AppKit                              0x00007fff4d60a66a 0x7fff4d604000 + 26218
23  ???                                 0x0000000120d24368 0x0 + 0
24  ???                                 0x0000000120471a93 0x0 + 0
25  ???                                 0x000000010f722dc9 0x0 + 0
26  RemoteDesktopManager                0x000000010dad0548 0x10d9a3000 + 1234248
27  RemoteDesktopManager                0x000000010db9b2c8 0x10d9a3000 + 2065096
28  RemoteDesktopManager                0x000000010db9e909 0x10d9a3000 + 2078985
29  RemoteDesktopManager                0x000000010da3616f 0x10d9a3000 + 602479
30  RemoteDesktopManager                0x000000010da389fb 0x10d9a3000 + 612859
31  RemoteDesktopManager                0x000000010d9d9cae 0x10d9a3000 + 224430
32  RemoteDesktopManager                0x000000010d9dac04 0x10d9a3000 + 228356
33  libdyld.dylib                       0x00007fff785bc015 0x7fff785bb000 + 4117

If I disable the crash reporter and let Xamarin handle the crash, I'll get something like this as an output in the console:

Stacktrace:

[...]

Native stacktrace:

    0   RemoteDesktopManager                0x0000000106c51261 mono_handle_native_crash + 257
    1   RemoteDesktopManager                0x0000000106bd0f16 altstack_handle_and_restore + 70
    2   libsystem_kernel.dylib              0x00007fff7870cafe __pthread_kill + 10
    3   libsystem_c.dylib                   0x00007fff7861a6fe raise + 26
    4   ???                                 0x0000000125d73864 0x0 + 4929828964
    5   RemoteDesktopManager                0x0000000106c62548 mono_jit_runtime_invoke + 1288
    6   RemoteDesktopManager                0x0000000106d2d2c8 do_runtime_invoke + 88
    7   RemoteDesktopManager                0x0000000106d2d240 mono_runtime_invoke + 208
    8   RemoteDesktopManager                0x0000000106b68fcc xamarin_invoke_trampoline + 5996
    9   RemoteDesktopManager                0x0000000106b69e3d xamarin_arch_trampoline + 189
    10  RemoteDesktopManager                0x0000000106b6b2d1 xamarin_x86_64_common_trampoline + 110
    11  AppKit                              0x00007fff4ddde516 -[NSApplication(NSResponder) sendAction:to:from:] + 312
    12  AppKit                              0x00007fff4d884083 -[NSControl sendAction:to:] + 86
    13  AppKit                              0x00007fff4d883fab __26-[NSCell _sendActionFrom:]_block_invoke + 136
    14  AppKit                              0x00007fff4d883eb1 -[NSCell _sendActionFrom:] + 183
    15  AppKit                              0x00007fff4d8c5168 -[NSButtonCell _sendActionFrom:] + 97
    16  AppKit                              0x00007fff4d88271a -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2438
    17  AppKit                              0x00007fff4d8c4eaf -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 777
    18  AppKit                              0x00007fff4d8811b4 -[NSControl mouseDown:] + 965
    19  AppKit                              0x00007fff4df7d715 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 5891
    20  AppKit                              0x00007fff4df7a36c -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2359
    21  AppKit                              0x00007fff4df79618 -[NSWindow(NSEventRouting) sendEvent:] + 497
    22  AppKit                              0x00007fff4ddda3d3 -[NSApplication(NSEvent) sendEvent:] + 307
    23  AppKit                              0x00007fff4d63b4ed -[NSApplication run] + 812
    24  AppKit                              0x00007fff4d60a66a NSApplicationMain + 804
    25  ???                                 0x0000000119ea4368 0x0 + 4729750376
    26  ???                                 0x00000001195fea93 0x0 + 4720683667
    27  ???                                 0x0000000108a14dc9 0x0 + 4439756233
    28  RemoteDesktopManager                0x0000000106c62548 mono_jit_runtime_invoke + 1288
    29  RemoteDesktopManager                0x0000000106d2d2c8 do_runtime_invoke + 88
    30  RemoteDesktopManager                0x0000000106d30909 do_exec_main_checked + 137
    31  RemoteDesktopManager                0x0000000106bc816f mono_jit_exec + 287
    32  RemoteDesktopManager                0x0000000106bca9fb mono_main + 9307
    33  RemoteDesktopManager                0x0000000106b6bcae xamarin_main + 1182
    34  RemoteDesktopManager                0x0000000106b6cc04 main + 36
    35  libdyld.dylib                       0x00007fff785bc015 start + 1

Debug info from gdb:

(lldb) command source -s 0 '/tmp/mono-gdb-commands.JSddT3'
Executing commands in '/tmp/mono-gdb-commands.JSddT3'.
(lldb) process attach --pid 21034
Process 21034 stopped
* thread #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff7870d1c2 libsystem_kernel.dylib`__wait4 + 10
libsystem_kernel.dylib`__wait4:
->  0x7fff7870d1c2 <+10>: jae    0x7fff7870d1cc            ; <+20>
    0x7fff7870d1c4 <+12>: movq   %rax, %rdi
    0x7fff7870d1c7 <+15>: jmp    0x7fff787039a5            ; cerror
    0x7fff7870d1cc <+20>: retq   
Target 0: (RemoteDesktopManager) stopped.

[...]

* thread #1, name = 'tid_307', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  * frame #0: 0x00007fff7870d1c2 libsystem_kernel.dylib`__wait4 + 10
    frame #1: 0x0000000106c512ee RemoteDesktopManager`mono_handle_native_crash(signal="SIGSEGV", ctx=<unavailable>, info=<unavailable>) at mini-exceptions.c:2720 [opt]
    frame #2: 0x0000000106bd0f16 RemoteDesktopManager`altstack_handle_and_restore(ctx=0x00007ffee90c7dc0, obj=0x0000000000000000, stack_ovf=0) at exceptions-amd64.c:799 [opt]
    frame #3: 0x00007fff7870cafe libsystem_kernel.dylib`__pthread_kill + 10
    frame #4: 0x00007fff7861a6fe libsystem_c.dylib`raise + 26
    frame #5: 0x0000000125d73864
    frame #6: 0x0000000106c62548 RemoteDesktopManager`mono_jit_runtime_invoke(method=0x0000000000000307, obj=<unavailable>, params=0x00007ffee90c85f0, exc=0x0000000000000000, error=<unavailable>) at mini-runtime.c:2791 [opt]
    frame #7: 0x0000000106d2d2c8 RemoteDesktopManager`do_runtime_invoke(method=0x00007fef865f2218, obj=0x0000000124949f30, params=0x00007ffee90c85f0, exc=0x0000000000000000, error=0x00007ffee90c8558) at object.c:2862 [opt]
    frame #8: 0x0000000106d2d240 RemoteDesktopManager`mono_runtime_invoke [inlined] mono_runtime_invoke_checked(method=<unavailable>, obj=0x0000000124949f30, params=0x00007ffee90c85f0, error=0x0000000000000000) at object.c:3016 [opt]
    frame #9: 0x0000000106d2d1ff RemoteDesktopManager`mono_runtime_invoke(method=0x00007fef865f2218, obj=0x0000000124949f30, params=0x00007ffee90c85f0, exc=<unavailable>) at object.c:2917 [opt]
    frame #10: 0x0000000106b68fcc RemoteDesktopManager`::xamarin_invoke_trampoline(type=Tramp_Default, self=0x0000600000c99e60, sel="Abort:", iterator=(RemoteDesktopManager`param_iter_next(IteratorAction, void*, char const*, unsigned long, void*, unsigned int*) at trampolines-x86_64.m:236), marshal_return_value=(RemoteDesktopManager`marshal_return_value(void*, char const*, unsigned long, void*, _MonoType*, bool, _MonoMethod*, MethodDescription*, unsigned int*) at trampolines-x86_64.m:307), context=0x00007ffee90c8b18) at trampolines-invoke.m:456
    frame #11: 0x0000000106b69e3d RemoteDesktopManager`::xamarin_arch_trampoline(state=0x00007ffee90c8b60) at trampolines-x86_64.m:545
    frame #12: 0x0000000106b6b2d1 RemoteDesktopManager`xamarin_x86_64_common_trampoline + 110
    frame #13: 0x00007fff4ddde516 AppKit`-[NSApplication(NSResponder) sendAction:to:from:] + 312
    frame #14: 0x00007fff4d884083 AppKit`-[NSControl sendAction:to:] + 86
    frame #15: 0x00007fff4d883fab AppKit`__26-[NSCell _sendActionFrom:]_block_invoke + 136
    frame #16: 0x00007fff4d883eb1 AppKit`-[NSCell _sendActionFrom:] + 183
    frame #17: 0x00007fff4d8c5168 AppKit`-[NSButtonCell _sendActionFrom:] + 97
    frame #18: 0x00007fff4d88271a AppKit`-[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2438
    frame #19: 0x00007fff4d8c4eaf AppKit`-[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 777
    frame #20: 0x00007fff4d8811b4 AppKit`-[NSControl mouseDown:] + 965
    frame #21: 0x00007fff4df7d715 AppKit`-[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 5891
    frame #22: 0x00007fff4df7a36c AppKit`-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2359
    frame #23: 0x00007fff4df79618 AppKit`-[NSWindow(NSEventRouting) sendEvent:] + 497
    frame #24: 0x00007fff4ddda3d3 AppKit`-[NSApplication(NSEvent) sendEvent:] + 307
    frame #25: 0x00007fff4d63b4ed AppKit`-[NSApplication run] + 812
    frame #26: 0x00007fff4d60a66a AppKit`NSApplicationMain + 804
    frame #27: 0x0000000119ea4368
    frame #28: 0x00000001195fea93
    frame #29: 0x0000000108a14dc9
    frame #30: 0x0000000106c62548 RemoteDesktopManager`mono_jit_runtime_invoke(method=0x0000000000000000, obj=<unavailable>, params=0x00007ffee90ca1b8, exc=0x0000000000000000, error=<unavailable>) at mini-runtime.c:2791 [opt]
    frame #31: 0x0000000106d2d2c8 RemoteDesktopManager`do_runtime_invoke(method=0x00007fef87a017d8, obj=0x0000000000000000, params=0x00007ffee90ca1b8, exc=0x0000000000000000, error=0x00007ffee90ca1f8) at object.c:2862 [opt]
    frame #32: 0x0000000106d30909 RemoteDesktopManager`do_exec_main_checked [inlined] mono_runtime_invoke_checked(method=<unavailable>, obj=<unavailable>, error=<unavailable>) at object.c:3016 [opt]
    frame #33: 0x0000000106d308c8 RemoteDesktopManager`do_exec_main_checked(method=0x00007fef87a017d8, args=<unavailable>, error=0x00007ffee90ca1f8) at object.c:4690 [opt]
    frame #34: 0x0000000106bc816f RemoteDesktopManager`mono_jit_exec(domain=<unavailable>, assembly=<unavailable>, argc=2, argv=0x0000608000053cc8) at driver.g.c:1036 [opt]
    frame #35: 0x0000000106bca9fb RemoteDesktopManager`mono_main [inlined] main_thread_handler at driver.g.c:1105 [opt]
    frame #36: 0x0000000106bca9c5 RemoteDesktopManager`mono_main(argc=<unavailable>, argv=<unavailable>) at driver.g.c:2226 [opt]
    frame #37: 0x0000000106b6bcae RemoteDesktopManager`::xamarin_main(argc=2, argv=0x00007ffee90ca518, launch_mode=XamarinLaunchModeApp) at launcher.m:662
    frame #38: 0x0000000106b6cc04 RemoteDesktopManager`main(argc=2, argv=0x00007ffee90ca518) at launcher.m:680
    frame #39: 0x00007fff785bc015 libdyld.dylib`start + 1
    frame #40: 0x00007fff785bc015 libdyld.dylib`start + 1

[...]

While there is a method to symbolicate the symbols at runtime in PLCrashReporter, their documentation seems to deter us from using it.

Is there any better way to do it with Xamarin?

Stable Channel: Xamarin.Mac 4.2.0, 15.6 Feature Release

$
0
0

Please see the corresponding "Release: 15.6" post on the Release Blog for the details about this release.

Invalid Signing Bug ? Where do I submit the bugs now ?

$
0
0

I have bug I wish to report,

After updating to todays release I can no longer run my application as it has been invalid signed, Just tried on another machine and worked before upgrading todays release, once updated I ran it again and I get the following.

Where do issue a bug to now, I think i saw that Issues to be place on Github correct ? Xamarin BugZilla ? Mono Git Hub ? Xamarin Git Hub ?

/Users/davidlilley/code/SomeProject /XXX/XXXX.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets (_CompileEntitlements target) ->

Entitlements.plist:  warning : iCloud entitlements such as 'com.apple.developer.ubiquity-container-identifiers' require a Provisioning Profile.
Entitlements.plist:  warning : Cannot expand $(TeamIdentifierPrefix) in Entitlements.plist without a provisioning profile.

CALayer issues while changing NSView background

$
0
0

I am trying to add a subview to a view by calling the AddSubview method on view. Since I want the View's and Subviews' background to be of custom colour, I customised their appearance by setting WantsLayer to true and changing the Layer.BackgroundColor property. It works fine - the subview gets added to the view with the desired background. But I am having strange issues as I am seeing blocks around the elements -

As you can see, I can see blocks of black colour around Progress Indicator and Loading label. I can even see a block of View's label (top left) - that is actually behind the subview. I guess the issue is because of the layer enabling.

P.S.: I know this is not a Xamarin.Mac specific question, but I have searched a lot about this issue and still not able to find anything. Posting here hoping that I would get to know what the issue could be. The app is a macOS menu bar app. The subview is loaded from a .xib file.

How can I track xamarin mac app unhandled exceptions

$
0
0

Hi, I want to get crash reports for unhandled exception in my xamarin mac application like hockey app used for tracking exceptions for android and ios apps. I have search a lot but not get any apps for tracking unhandled exception. Please suggest any app for tracking exceptions in xamarin.mac. Thanks in advance.

How to use NSCollectionView from .xib files

$
0
0

Hi Everyone

I'm trying to use NSCollectionView from my .xib file not from storyboard. Its throwing some error :( when I'm trying to register the class for the collection view

collectionView.RegisterClassForItem(typeof(EmployeeItemController), "EmployeeCell");

Can anyone please guide me to achieve this.

Thanks

How to inactive NSTableView vertical scrolling in xamarin mac

$
0
0

Hi everyone, I have a list of data in NsTableView. My requirement is need to disable vertical scrolling of the table view. I have gone through many suggestions but not luck. Please suggest any idea. Thanks in advance.

Linker error after updating to Xamarin.Mac 7.4

$
0
0

Hello,

I just updated to Xamarin.Mac 7.4, and I am now seeing a linker error when trying to build my project:

Process exited with code 1, command:
xcrun -sdk macosx clang -g -mmacosx-version-min=10.11 -arch x86_64 -fobjc-runtime=macosx -ObjC ...
ld: framework not found MetalPerformanceShaders
clang : error : linker command failed with exit code 1 (use -v to see invocation)

I didn't add MetalPerformanceShaders (nor do I need it). I am developing on macOS 10.11.6, and (as you see) targeting minimum macOS version 10.11 as well.

Any ideas on how to fix this?

scroll bar for label if content is more than width in xamarin.mac application

$
0
0

i have NSscrollview but the scroll bar dont appear. the width of the label remains same regardless of its content. how to make the width of the label change according to its content and enable scrolling for the view. any help would be greatly appreciated.

WebView Load Bundled Image (GIF) in Xamarin.Mac

$
0
0

Can somebody show me how to load a bundled image resource into a WebKit.WebView? The image resides in the Resources folder and is set as BundleResource/Do not copy? I'm trying to LoadHtmlString(), but I can't seem to get the "<img src=..." reference correct. At least I think this is the problem I'm having. I've tried both of these for the src, but to no avail.

        string filePath = "Resources/ready.png"; // remember case-sensitive
        string localGifPath = Path.Combine(NSBundle.MainBundle.BundlePath, filePath);

Actually, I'm doing this to display an animated GIF because the GIF does not animate as the Image property in an NSImage object. Is the WebView the only way to do this, assuming the WebView even works? If tire's a better way, please let me know.

Thanks


AudioObjectGetPropertyData not found in xamarin..

IDB Agent on the Mac?

$
0
0

If I am looking for the IDB Agent on macOS v10.13.3, what is it official system name and where would I search to see if it installed and running?

Using dllmap

$
0
0

Cross posted from Stack Overflow for greater visibility...

I'm trying to use a custom build of sqlite with MonoMac, effectively as per this question.

However, using dllmap doesn't seem to be working.

My custom dylib is being deployed into [myapp.app]/Contents/Frameworks/mycustomlib.dylib

Output of otool -L mycustomlib.dylib looks correct:

@executable_path/../Frameworks/mycustomlib.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

My myapp.exe.config file looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
    <dllmap dll="sqlite3" target="@executable_path/../Frameworks/mycustomlib.dylib" os="!windows" />
</configuration>

And I have verified that it is being copied alongside myapp.exe in [MyApp.app]/Contents/MonoBundle.

I can force this to work by recompiling Mono.Data.Sqlite and directly replacing the reference to sqlite3 with mycustomlib. However, the dllmap route is much nicer.

What am I missing? How can I debug this?

TL,DR Does dllmap work on Xamarin.Mac? How can I debug it?

CryptoKitBinding release build

$
0
0

When I build my MacOS application, with the mmp arguments --registrar:dynamic, it shows for less than a second the mainscreen, then it crashes.

Without that arguments, my solution failed to compile with the following errors:

xcrun -sdk macosx clang -mmacosx-version-min=10.13 -arch x86_64 -fobjc-runtime=macosx -Wno-unguarded-availability-new -ObjC -framework Foundation -framework AppKit -framework QuartzCore -framework WebKit -framework CoreVideo -framework CloudKit -framework Security -framework SystemConfiguration -framework OpenGL -framework CoreFoundation -framework CoreServices -framework ApplicationServices -framework Carbon -framework IOKit -u xamarin_timezone_get_data -u _xamarin_nfloat_objc_msgSend -u _xamarin_nfloat_objc_msgSendSuper -u _xamarin_IntPtr_objc_msgSend_IntPtr -u _xamarin_IntPtr_objc_msgSendSuper_IntPtr -u _xamarin_get_block_descriptor /Library/Frameworks/Xamarin.Mac.framework/Versions/4.2.0.20/lib/libxammac.a -o /Users/Developer/Desktop/Projects/app/Source/app.MacOS/bin/Test/app.MacOS.app/Contents/MacOS/app.MacOS -D_THREAD_SAFE -I/Library/Frameworks/Xamarin.Mac.framework/Versions/4.2.0.20/lib/pkgconfig/../../include/mono-2.0 /Library/Frameworks/Xamarin.Mac.framework/Versions/4.2.0.20/lib/pkgconfig/../../lib/libmonosgen-2.0.a -liconv -x objective-c++ -I/Library/Frameworks/Xamarin.Mac.framework/Versions/4.2.0.20/include /Users/Developer/Desktop/Projects/app/Source/app.MacOS/obj/Test/mmp-cache/registrar.m -fno-caret-diagnostics -fno-diagnostics-fixit-info -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk /Users/Developer/Desktop/Projects/app/Source/app.MacOS/obj/Test/mmp-cache/main.m
Process exited with code 1, command:
xcrun -sdk macosx clang -mmacosx-version-min=10.13 -arch x86_64 -fobjc-runtime=macosx -Wno-unguarded-availability-new -ObjC -framework Foundation -framework AppKit -framework QuartzCore -framework WebKit -framework CoreVideo -framework CloudKit -framework Security -framework SystemConfiguration -framework OpenGL -framework CoreFoundation -framework CoreServices -framework ApplicationServices -framework Carbon -framework IOKit -u _xamarin_timezone_get_data -u _xamarin_nfloat_objc_msgSend -u _xamarin_nfloat_objc_msgSendSuper -u _xamarin_IntPtr_objc_msgSend_IntPtr -u _xamarin_IntPtr_objc_msgSendSuper_IntPtr -u _xamarin_get_block_descriptor /Library/Frameworks/Xamarin.Mac.framework/Versions/4.2.0.20/lib/libxammac.a -o /Users/Developer/Desktop/Projects/app/Source/app.MacOS/bin/Test/app.MacOS.app/Contents/MacOS/app.MacOS -D_THREAD_SAFE -I/Library/Frameworks/Xamarin.Mac.framework/Versions/4.2.0.20/lib/pkgconfig/../../include/mono-2.0 /Library/Frameworks/Xamarin.Mac.framework/Versions/4.2.0.20/lib/pkgconfig/../../lib/libmonosgen-2.0.a -liconv -x objective-c++ -I/Library/Frameworks/Xamarin.Mac.framework/Versions/4.2.0.20/include /Users/Developer/Desktop/Projects/app/Source/app.MacOS/obj/Test/mmp-cache/registrar.m -fno-caret-diagnostics -fno-diagnostics-fixit-info -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk /Users/Developer/Desktop/Projects/app/Source/app.MacOS/obj/Test/mmp-cache/main.m
/Users/Developer/Desktop/Projects/app/Source/app.MacOS/obj/Test/mmp-cache/registrar.m(10600,2): warning GB7F1753F: method possibly missing a [super splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:] call [-Wobjc-missing-super-calls]
Undefined symbols for architecture x86_64:
"_OBJC_CLASS
$TKBERTLVRecord", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKCompactTLVRecord", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSimpleTLVRecord", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCard", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardATR", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardATRInterfaceGroup", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardPINFormat", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardSlot", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardSlotManager", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardToken", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardTokenDriver", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardTokenSession", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardUserInteraction", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardUserInteractionForPINOperation", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardUserInteractionForSecurePINChange", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKSmartCardUserInteractionForSecurePINVerification", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTLVRecord", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKToken", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenAuthOperation", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenDriver", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenKeyAlgorithm", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenKeyExchangeParameters", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenKeychainCertificate", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenKeychainContents", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenKeychainItem", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenKeychainKey", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenPasswordAuthOperation", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenSession", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$TKTokenSmartCardPINAuthOperation", referenced from:
objc-class-ref in registrar-6bdddd.o
"_OBJC_CLASS
$_TKTokenWatcher", referenced from:
objc-class-ref in registrar-6bdddd.o
ld: symbol(s) not found for architecture x86_64
clang : error : linker command failed with exit code 1 (use -v to see invocation)

/Users/Developer/Desktop/Projects/app/Source/app.MacOS/clang: Error: linker command failed with exit code 1 (use -v to see invocation) (app.MacOS)
/Users/Developer/Desktop/Projects/app/Source/app.MacOS/MMP: Error MM5109: Native linking failed with error code 1. Check build log for details. (MM5109) (app.MacOS)

The error report i get from macos contains the following information:

Process: app.MacOS [96901]
Path: /Users/USER/Desktop/*/app.MacOS.app/Contents/MacOS/app.MacOS
Identifier: nl.rijksoverheid.app.macos.dev
Version: 1.0.0 (4)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: app.MacOS [96901]
User ID: 501

Date/Time: 2018-03-07 15:19:16.517 +0100
OS Version: Mac OS X 10.13.3 (17D102)
Report Version: 12
Anonymous UUID: 857B28F5-C450-0799-C308-057D25EBABBE

Sleep/Wake UUID: CF20D6A3-9B57-49F7-957A-AD15CE242180

Time Awake Since Boot: 140000 seconds
Time Since Wake: 21000 seconds

System Integrity Protection: enabled

Crashed Thread: 0 tid_307 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

VM Regions Near 0:
-->
__TEXT 000000010ce28000-000000010d1cc000 [ 3728K] r-x/rwx SM=COW xv [/Users/Developer/Desktop/Projects/app/Source/app.MacOS/bin/Test/app.MacOS.app/Contents/MacOS/app.MacOS]

Thread 0 Crashed:: tid_307 Dispatch queue: com.apple.main-thread
0 nl.rijksoverheid.app.macos.dev 0x000000010d0f400d eglib_log_adapter + 13 (mono-logger.c:368)
1 nl.rijksoverheid.app.macos.dev 0x000000010d107e33 monoeg_g_logv + 83 (goutput.c:116)
2 nl.rijksoverheid.app.macos.dev 0x000000010d10804f monoeg_assertion_message + 143 (goutput.c:137)
3 nl.rijksoverheid.app.macos.dev 0x000000010cf546f3 mono_jit_thread_attach + 179
4 nl.rijksoverheid.app.macos.dev 0x000000010ce546c0 xamarin_switch_gchandle + 144 (runtime.m:1771)
5 nl.rijksoverheid.app.macos.dev 0x000000010ce57009 xamarin_release_trampoline + 105 (trampolines.m:485)
6 libobjc.A.dylib 0x00007fff552ca087 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 817
7 nl.rijksoverheid.app.macos.dev 0x000000010ce5d8bd xamarin_main + 1245 (launcher.m:675)
8 nl.rijksoverheid.app.macos.dev 0x000000010ce5e7d4 main + 36 (launcher.m:680)
9 libdyld.dylib 0x00007fff55ec4115 start + 1

Thread 1:
0 libsystem_kernel.dylib 0x00007fff56014562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5614f26f _pthread_wqthread + 1552
2 libsystem_pthread.dylib 0x00007fff5614ec4d start_wqthread + 13

Thread 2:
0 libsystem_kernel.dylib 0x00007fff56014562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5614f26f _pthread_wqthread + 1552
2 libsystem_pthread.dylib 0x00007fff5614ec4d start_wqthread + 13

Thread 3:
0 libsystem_kernel.dylib 0x00007fff56014562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5614f26f _pthread_wqthread + 1552
2 libsystem_pthread.dylib 0x00007fff5614ec4d start_wqthread + 13

Thread 4:
0 libsystem_kernel.dylib 0x00007fff56014562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5614f06a _pthread_wqthread + 1035
2 libsystem_pthread.dylib 0x00007fff5614ec4d start_wqthread + 13

Thread 5:
0 libsystem_kernel.dylib 0x00007fff56014562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5614f06a _pthread_wqthread + 1035
2 libsystem_pthread.dylib 0x00007fff5614ec4d start_wqthread + 13

Thread 6:
0 libsystem_kernel.dylib 0x00007fff56014562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5614f26f _pthread_wqthread + 1552
2 libsystem_pthread.dylib 0x00007fff5614ec4d start_wqthread + 13

Thread 7:
0 libsystem_kernel.dylib 0x00007fff56014562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5614f06a _pthread_wqthread + 1035
2 libsystem_pthread.dylib 0x00007fff5614ec4d start_wqthread + 13

Thread 8:
0 libsystem_kernel.dylib 0x00007fff56014562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5614f26f _pthread_wqthread + 1552
2 libsystem_pthread.dylib 0x00007fff5614ec4d start_wqthread + 13

Thread 9:
0 libsystem_kernel.dylib 0x00007fff56013cee __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff56150662 _pthread_cond_wait + 732
2 libc++.1.dylib 0x00007fff53ef9d43 std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration > >) + 93
3 com.apple.JavaScriptCore 0x00007fff320ebd25 std::__1::cv_status std::__1::condition_variable::wait_until<std::__1::chrono::steady_clock, std::__1::chrono::duration > >(std::__1::unique_lock&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration > > const&) + 117
4 com.apple.JavaScriptCore 0x00007fff320ebc10 std::__1::cv_status std::__1::condition_variable_any::wait_until<std::__1::unique_lock, std::__1::chrono::steady_clock, std::__1::chrono::duration > >(std::__1::unique_lock&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration > > const&) + 96
5 com.apple.JavaScriptCore 0x00007fff320ebaa9 bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadRunLoop() + 233
6 com.apple.JavaScriptCore 0x00007fff320ebd78 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete >, void (*)(bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*), bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*> >(void*) + 40
7 libsystem_pthread.dylib 0x00007fff5614f6c1 _pthread_body + 340
8 libsystem_pthread.dylib 0x00007fff5614f56d _pthread_start + 377
9 libsystem_pthread.dylib 0x00007fff5614ec5d thread_start + 13

Thread 10:: com.apple.coreanimation.render-server
0 libsystem_kernel.dylib 0x00007fff5600a7c2 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff56009cdc mach_msg + 60
2 com.apple.QuartzCore 0x00007fff396cbce5 CA::Render::Server::server_thread(void*) + 481
3 com.apple.QuartzCore 0x00007fff396cbaf6 thread_fun + 25
4 libsystem_pthread.dylib 0x00007fff5614f6c1 _pthread_body + 340
5 libsystem_pthread.dylib 0x00007fff5614f56d _pthread_start + 377
6 libsystem_pthread.dylib 0x00007fff5614ec5d thread_start + 13

Thread 11:
0 libsystem_kernel.dylib 0x00007fff56014562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5614f26f _pthread_wqthread + 1552
2 libsystem_pthread.dylib 0x00007fff5614ec4d start_wqthread + 13

Thread 12:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff5600a7c2 mach_msg_trap + 10
1 libsys

How can I add event in controls(nsbutton, nstextfield...more..)

$
0
0

In c# winform case,
event add code like below

button.click += functionName;
textField.textChanged += functionName;
button.mouseOver +=functionName;

but, I can't find in xamarin mac.

I know It use overrride event on nsview, nswindow .
but there are no howto on NSControls .

I want to add like this,

button.mouseOver, button.mouseLeave, 
textBox.textChanged, textBox.enabled, textBox.disabled.... 

Please let me know, how can I create event in programmatically.

Viewing all 1429 articles
Browse latest View live