interface

iPad Interface Builder Localization Problem

I have 3 .xib files, two were generated by Xcode (mainWindow.xib, DetailView.xib) and I created one (WordSearchViewController.xib). I selected "Make Localizable" from the Get Info window in Xcode. I then dragged the xibs in Xcode to a group named Resources. I ran the app in the simulator and it worked. HOWEVER, anytime I change something...

Has .NET 4 solved this simple generic interface problem?

Suppose you have an interface like this: public interface IDoSomething<out T> { T DoSomething(object value); } To be able to call DoSomething on that interface without knowing the type of T, you have to create this: public interface IDoSomething { object DoSomething(object value); } Modify your original interface to inherit...

Using an interface vs. MVVM light Messenger for data requests

I've got a plugin that needs access to certain information in order to populate its GUI elements properly. However, this plugin should not know about all other plugins, so I want it to request this information from the application. In situations like this, I always create an interface for data exchange, and then pass this interface to ...

Interface design

A client of mine asked for a basic version of an iPhone application to work with, and has been happily using it for 2 months now. Now he wants me to implement the full version but I'm having trouble finding a good interface to make it both visually attractive and practical in use: I should use a completely different tab-bar at the botto...

Multiple XIBs same File's Owner

I am trying to create a two view, single controller application as follows: I have two XIB's. Each with the same File's Owner. As a test, I have placed a UILabel on each XIB. I have connected the File Owner to the UILabel in each XIB. The outlet property is the same. When I instantiate the nib using loadNibNamed I also set the 'owner' ...

C# Classes and Interfaces

Should a class implement an interface always in order to enforce a sort of 'contract' on the class? When shouldn't a class implement an interface? Edit: Meaning, when is it worthwhile to have a class implement an interface? Why not have a class just have public members and private members with various accessor/setter functions? (Note:...

Interchanging delegate/function and interface in D2

I'd like to be able to define a function that takes an interface, but can be fulfilled with a delegate or function that provide the same functionality. For example, in C++ I can write something like: typedef std::function<int (float)> toInt; void fun(toInt dg) { ... } struct impl1 { int operator()(float x) { ... } }; int impl2(fl...

method parameter with multiple interface restrictions.

Hi, In C# it's possible to defined a method parameter with two interface restrictions. This with bounds. For example. interface IA { int A {get;} } interface IB { int B {get;} } void Foo<T>(T param1) where T: IA, IB {} So two interfaces, and the first parameter (param1) of the method Foo should implement both interfaces. But ...

What cmdlets use the IHostUISupportsMultipleChoiceSelection interface to prompt for choices?

I don't remember ever being prompted for multiple selections before in PowerShell, but I've seen several examples of hosts implementing this interface. Unfortunately, those are the only references I've seen to the interface. I've never seen "here's how to test that you're implementing it correctly". ...

Event aggregator - cast object to interface

Hello! How to find out if object supports IHandle<T> and is there any possible workaround to achieve this in delphi (2010, XE)? Also has anybody seen a nice implementation of event aggregator for delphi? IHandle<TMessage> = interface procedure Handle(AMessage: TMessage); end; EventAggregator = class private FSubscribers: TList<TObj...

problem with properties of IB plugin object

Hello I have some object witch I represent in IB Plugin. It is controller object with some properties; For test this object I do next: 1 in IB I set value of properties un Inspector View (it is work); 2 I bound my Object from IB to another object using 'New Referencing OUTLET' 3 Now I want saw some value witch I set of my obj from...

Class that implements an interface with IList of another interface property...how to?

I have two interfaces like these: public interface IMyInterface1 { string prop1 { get; set; } string prop2 { get; set; } } public interface IMyInterface2 { string prop1 { get; set; } IList<IMyInterface1> prop2 { get; set; } } I have defined two classes that implement the interfaces: public class MyClass1 : IMyInterfa...

Which interface should I implement to have parse method

Hi, I'm working with webservices. I have a java object defined for the request. I'd like to create a java object of this type from a String or a XmlObject. Which interface should I implement to use the method parse to do this? Thanks and regards ...

Delphi objects, NIL objects and Interfaces

I am looking for hints on how to debugging a crash in an application that uses the MS XML wrappers in the Delphi VCL. I suspect memory corruption, or some kind of obscure evil thing happening between objects and interfaces, such as reference counting bugs, or heap corruption. The question is, in effect: how do I debug such a crash? T...

Workaround or alternative to no static methods on an interface

I'm implementing some naive searching in my application, and searches will take place on a couple of different object types (Customer, Appointment, Activity, etc.). I'm trying to create an interface that will have types that are searchable. What I'd like to do is something like this: public interface ISearchable { // Contains the 'a...

how can I use an enum to replace several fields? How can I pass these values to an interface?

I have a class which 4 fields which I need to be able to set and get. I have to use setters and getters, but also instead of using regular fields, have to use an enum. This concept confuses me - considering the fields arent necessarily constants. I'll give an example If we call the class Bear, the 4 fields may be: name, type, nickname, ...

Type of the Item property in F#

Hello, Consider the interface: type IVector = abstract Item : int -> float Now, let us define the class: type DenseVector(size : int) = let mutable data = Array.zeroCreate size interface IVector with member this.Item with get n = data.[n] What about supply a method to mutate the n-th entry of the dense vect...

Clojure's protocols influences?

Was Clojure influences by ObjectiveC Protocols? If no then how are they difference? ...

What does return type of ICollection<Person> mean?

I'm looking at some code samples for Entity Framework 4 and the author created a method that returns ICollection<Person>. I know ICollection is an interface. I know Person is the type of object in the collection. I know I'm getting back a collection of Persons. The question. Why ICollection? Why not List<>? Why is an interface being use...

Binding DataGridView to implementing class in .NET

How should I bind my collection of T objects which implements an interface and adds more properties to a DataGrid? Here is an example: // interface public interface IPerson{ [DisplayName(@"FullName")] string Name{ get; } } // implementation public class Employee : IPerson{ [DisplayName(@"Net Salary")] public int Salary { get { ret...