Forum Xamarin.Mac


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Syncronise a cocoa app

I have a client-server c# application built as cocoa application on the client side. My problem is described by the following example: a message is sent to the server that something is needed. My client is async and when receives a message checks the message type. Depending on the message type, it should do something client side. For example, if client requests to log in, the server will send him back null (if he introduced wrong data) or an User ( which is a model, a class). The message is received by the client, and he should either put something in a NSTextField(a message because the introduced data doesn't exist) either to show a new window for example. Instead of taking this information --null or user-- back to NSViewController, I have a class, Handler, which has a method and depending on the message type should do NSViewController.showSomethingInNsTextifeld or pop up a new window. Now, I know static methods would have been bad practice and anyways I couldn't define static methods for this, so I made an interface, IController. Each NSViewController implements this IController interface. So now in my Handler I should only have the interface as instance variable, and in each NSViewController I have a new instance(this), where this will be the interface. Everything should work fine by now, except that my interface is always left behind. By this I mean, it is always in a different NSViewController and showing windows/labels in the wrong one. I would appreciate any help since I have this problem for over a week now. Thank you in advance and sorry for the long post..

Sign In or Register to comment.