Questions tagged as 'classes'

2
answers

How to make a class inside another inherit a variable instantiated from the latter in python?

See the following python script: class a: def __init__(self,n): self.n=n class b: def __init__(self): ## o que botar aqui para receber a variável self.n ##...
asked by 24.01.2017 / 20:37
1
answer

error: field has incomplete type

I get this error    error: field has incomplete type when doing something like: class MinhaClasse { MinhaClasse teste; // Erro aqui }; I already tried to add this line at the beginning of the code class MinhaClasse; , but it...
asked by 01.02.2018 / 15:39
1
answer

NameError: name 'Window' is not defined [closed]

I'm following this PDF , I'm on page 10, the code gives error and I I do not know why. from tkinter import * class Janela: def __init__(self,toplevel): self.fr1 = Frame(toplevel) self.fr1.pack() self.botao1 = Butt...
asked by 28.11.2018 / 13:44
1
answer

XSD For Class C # Enum

I'm generating a class with XSD.EXE from a schema. I am summarizing the posting only the part of the schema that generates the enum that I doubt. <xs:simpleType name="TCodUfIBGE"> <xs:annotation> <xs:documentation>...
asked by 21.09.2016 / 16:41
4
answers

What's wrong with my class's function to decrease the value?

I'm developing a class so I can better manage my items in a more organized way. When the value of the variable is less than the minimum value was to go to the maximum value, however, in practice this is not happening, it will stop some strange v...
asked by 10.10.2017 / 00:49
1
answer

I can not get functions from the System.Management class

I'm not able to call some functions of the System.Management class; for my program. I've tried to using System.Management; or System.Management.ManagementObject but it also does not work. Code: static string getid() {...
asked by 24.04.2017 / 14:54
3
answers

How to list files in a directory?

I use the following code: $path = 'pasta_desejada'; $dir = new DirectoryIterator($path); foreach ($dir as $fileInfo) { $ext = strtolower( $fileInfo->getExtension() ); if( in_array( $ext, $types ) ) echo $fileInfo->getFilename();...
asked by 25.08.2016 / 20:25
1
answer

Get instance of child class

I have a class: class Children extends Database So, Children is the child class and Database the parent class, in the parent class I have the attribute: protected $object = null; The value of it should be the instance of...
asked by 06.07.2016 / 20:16
1
answer

Problems starting methods in a python class?

I'm new to python and I started with classes now, I tried to start a class but for some reason always gives error, the error changes but always gives, at the moment I am with the code this way: class Inimigo: def __init__(self, vida):...
asked by 10.08.2018 / 22:57
1
answer

How to pass data (string) from a class to the Viewcontroller TextField

I want to pass data from a class of type NSObject to be shown in my TextField Viewcontroller . I tried to use the prepareForSegue function but could not. Someone knows how to pass the data, even if it is using the prepa...
asked by 30.05.2014 / 14:04