Newbie Q.
In my MainViewController, which is the first visible view.
I have a Circle class (no XIB) which subclasses UIView and overrides the draw method to draw a circle. Hello-World simple.
In the MainViewController how do I add the custom class I wrote so that it appears programatically?
Do I need to do anything besides overriding...
Is the following concept possible, or will I have trouble serializing this to the Client. Assuming that all comms are only dealing with BaseContractClasses but the Server uses the special sub-class to collate extra server-only data.
[DataContract]
public class BaseContractClass
{
[DataMember]
public int valueToTransmit;
}
public cl...
Hi,
I have a genericised class that I wish to subclass as follows:
public class SomeTable<T extends BaseTableEntry>
extends BaseTable<T>
{
public SomeTable(int rows, int cols)
{
super(rows, cols, SomeTableEntry.class);
//Does not compile:
//Cannot find symbol: constructor BaseTable(int, int, java.la...
I have a Core Data model where I have an entity A, which is an abstract. Entities B, C, and D inherit from entity A. There are several properties defined in entity A which are used by B, C, and D.
I would like to leverage this inheritance in my model code. In addition to properties, I am wondering if I can add methods to entity A, which...
Hi.
I am having problems. I have a subclass based on Randy Patterson's fluent interface example here:
Randy Patterson's Fluent Interface Design Page
I am subclassing a User class and need to pass the properties set in it to the below CreateNewUser method within the UserFluentInterface subclass.
public void CreateNewUser()
...
Hello,
I'm building form validation controls for our C# ASP application. The bulk of the work is handled by a BaseValidator control (subclassing System.Web.UI.UserControl), which also has the markup for the validation output. This is then extended by subcontrols like PasswordValidator, that provides the Validate method and any extra fie...
Why are we allowed to run this code:
int* FunctionB(int x)
{
int temp =30;
//more code
return &temp;
}
It seems to me that I am not returning what I said I would. Why is it that a memory address can be returned if I declared the return type to be a pointer. Isn't a pointer something that points to a memory address, not...
Hi,
Im trying to map the following classes:
public abstract class ScheduleType
{
public virtual int Id { get; set; }
public virtual TypeDiscriminatorEnum Discriminator { get; set; }
}
public class DerivedScheduleType : ScehduleType
{
public virtual bool MyProperty { get; set; }
}
public class ScheduleTypeMap : ClassMap...
Hi,
I have a User hibernate class, Clerk class and Consumer class. All these maps to their own tables in database. The User PK also acts as Clerk's and Consumer's PK.
So now my problem is that if a user is initially a Clerk, he has a record in Users table and Clerks table. If that user wants to become a consumer, I want to link that U...
I am attempting to use the Microsoft enterprise Validation methods to perform validation in my entities. In my base class I have the following method:
public class BaseEntity
{
public bool IsValid()
{
return Validate().IsValid;
}
public ValidationResults Validate()
{
return Validation.Validate<this.GetType()>(this)...
I have a class:
class A(object):
def __init__(self,a,b,c,d,e,f,g,...........,x,y,z)
#do some init stuff
And I have a subclass which needs one extra arg (the last W)
class B(A):
def __init__(self.a,b,c,d,e,f,g,...........,x,y,z,W)
A.__init__(self,a,b,c,d,e,f,g,...........,x,y,z)
self.__W=W
It seems du...
I have a nib file for a UITableViewCell subclass I made, it's height is set to 25 in the nib, however when the application loads, this is not the case. It loads to the default size. Here is my code for the implementation of the cell.
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)table...
Hi everyone,
I want to subclass the list type and have slicing return an object of the descendant type, however it is returning a list. What is the minimum code way to do this? If there isn't a neat way to do it, I'll just include a list internally which is slightly more messy, but not unreasonable.
Thank you!
Edit: My code so far:
c...
Say that I have Class A and Class B. Class B is a subclass of Class A. Class A contains some properties and then Class B extends the Class A superclass by adding some additional properties, specific to that subclass. I have created a Class A object and now wish to convert the object to be a Class B type object at runtime, so that I can a...
I'm finishing a small project, an iPhone game.
I've been expanding my GameObject class to include powerups and mines. These are physically identical to each other.
Late last night I came up with the genius idea of making two subclasses of GameObject. They're each less than a hundred lines long. I also have to do stuff like cast them t...
I'd like to extend/subclass admin Groups & Users classes in Django.
CourseAdmin group should be doing what admin can do, and they have extra information like email, phone, address.
CourseAdmin should be able to create CourseAdmins, Teachers, Courses and Students.
Teacher should be able to edit courses and students belong to them. They ...
I have a Model Property which has subclasses using STI,
and which I would like all to use the same controller with only different view partials depending on the subclass.
Property
Restaurant < Property
Landmark < Property
It works find except I'm not sure how to discern the subclass inside the controller to render the correct view. ...
This is the setup for my 2 entities:
public class Person {
public Guid Id {get;set;}
public string Name {get;set;}
}
public class Immortal : Person {
public string DarkName {get;set;}
}
Here's what their mapping looks like:
<class name="Person">
<id name="Id">
<generator class="guid.comb"/>
</id>
<property name="Name...
Hi All,
I have a memory leak when just using subclass of UIView. It leaks 128 bytes and goes all the way to down thru CoreGraphics etc. My subclass is just a generated skeleton without anything in it. When I use just UIView instead of ScrollView no leak are reported. What could it be and what I am missing?
Thanks a lot,
ALex.
========...
Hello.
function A() {
this.myProp = document.createElement("div"); }
function B(id) {
this.myProp.id = id;
document.body.appendChild(this.myProp); }
B.prototype = new A();
window.onload = function() {
new B("hello");
new B("goodbye"); }
What happens here is that I end up with one div with id "goodbye". What I wo...