Questions tagged [method-call]

386 questions
0
votes
1 answer

objective c: call method in masterViewController from detailViewController

I am using x-codes Master-detail template. I have a button in the detailView that has its action also in the detailViewController. Within this action method i need to call a method that is in the masterViewController. How can I do this ?
0
votes
1 answer

Android: How to call a parent Activity method from a child custom view?

Please, give me a hint how to solve this situation: I have two custom views in my Activity and I'd like to call an Activity method after clicking a button in one of custom views (Y). I can get the X view from parent Acitivity by findViewById() and…
Marcel Bro
  • 4,907
  • 4
  • 43
  • 70
-1
votes
3 answers

How to call object of class by input?

I am generating a class of persons and want to get information about a certain person by input. I would like to use the str funtction because I am trying to understand it better. My Idea goes as follows: class Person: __init__(self, f_name,…
ThorbenL
  • 11
  • 4
-1
votes
1 answer

I don´t understand why this call does not work (Java)

The class Maze instanciates an 2D boolean-Array with the method: generateMaze(int width, int height) which has to be used in Walker. The method-call to create the boolean[][] happens at the main of the Walker class My aim is to call the boolean[ ][…
-1
votes
1 answer

Why is my Python code skipping over the trigging of a nested function?

This code does run but it's not triggering the inner function playerAction() when the main_game_loop() is triggered. -I've used the IntelliJ debugger and it shows the condition, while myPlayer.game_over is False:, as being False. (pic added) img…
-1
votes
1 answer

How to Build Expression Tree for Invoke Method from Generic Interface

I'm sorry to ask, how can i invoke method using other that method.Invoke, because some article said, method.Invoke has slower performance. Actually i'm using .NET Core 3.1. Example, i have a structure code something like this. public class Message {…
Om Rudi
  • 1
  • 1
-1
votes
1 answer

Python - how to return values from function in other script

I want to return a value in a script MAIN.py where the function is stated in another script? How do I do this? In a function SUB.py I have defined: def SUM_POWER(a,b): c = a+b d = a**b return [c,d] Now I want to get in a script…
Jeroen
  • 801
  • 6
  • 20
-1
votes
1 answer

Flag Automatic Rolling Counter or Text to Call Javascript Function

I have an innerHTML that contains numeric or textual data that continues to flip either digits or chars according to the js automation that I've coded. Now, I'd like to use these rolling digits or chars as a flag to call other functions, and this…
zztops
  • 9
  • 1
  • 4
-1
votes
1 answer

Beginner in Java, Eclipse: How call method? (simple)

I am beginner (newbie) in Java. I have downloaded the Eclipse environment to be able to code and run Java programs. Now my problem is simple: I am trying to run the code below, specifically I want to compute the so called edit distance between two…
-1
votes
3 answers

Method overloading in java, how to read variable in variable.method for method declaration? java

I want to create a method called plus that adds the variable i1 to i2. However I don't understand how I call on my method plus with the variabel i1 according to the given code below (code snippet 2). My initial thought was to do it like this (but…
Norruas
  • 61
  • 1
  • 9
-1
votes
1 answer

How can I test if a class method is calling another method from one of the classes's private objects

I'm trying to create Unit tests for a project. In my project I have a Menu Class, and a VerticalOptions Class. My menu class has a private VerticalOptions object and a public handleInput method. When I call my menu's handleInput(key) method,…
-1
votes
1 answer

Creating a running total for one of my methods

Hello i am having trouble creating a running total of one of my methods. public double calcProduct() { productTotal = price * qty * shipCost; return productTotal; } the method i have listed above is supposed to calculate the total of 4…
Besco
  • 39
  • 1
  • 7
-1
votes
1 answer

Nodejs result and error handling - 'TypeError: callback is not a function

I am writing a method that returns either a result or an error. myMethod.methodName = (param1, param2, param3, error, callback) => { try { myDB.findOne({ param1: value}, function (err, result) { if (err) { …
-1
votes
3 answers

How to run a method from a different class - JAVA

I am trying to call the toh method from my main class(Driver). When I make the call it gives me a null pointer exception. How can I call the toh method in Hanoi from the driver class? When I combine the classes into one it works fine but I need them…
Art
  • 29
  • 6
-1
votes
4 answers

Calling method in another class

This looks like one of the 10000th similar topics but I just can't find something similar. I've spent enough time on this already not to ask you guys. What I'm trying to achieve is to use method "calculateM()" in another class. They both have…
Lazio
  • 105
  • 1
  • 10