Questions tagged [method-declaration]
36 questions
198
votes
4 answers
What do the plus and minus signs mean in Objective-C next to a method?
In Objective-C, I would like to know what the + and - signs next to a method definition mean.
- (void)loadPluginsAtPath:(NSString*)pluginPath errors:(NSArray **)errors;

gyurisc
- 11,234
- 16
- 68
- 102
116
votes
3 answers
Java "params" in method signature?
In C#, if you want a method to have an indeterminate number of parameters, you can make the final parameter in the method signature a params so that the method parameter looks like an array but allows everyone using the method to pass as many…

Omar Kooheji
- 54,530
- 68
- 182
- 238
8
votes
3 answers
Make Xcode 4.3 warn about undeclared methods that exist in the current @implementation
Xcode 4.3 doesn't warn about undeclared methods when they exist in the current
@implementation, which is a great new feature. However, this is causing an issue in certain circumstances when using my project on Xcode 4.2.
How do I re-enable the…

Jess Bowers
- 2,846
- 1
- 22
- 42
7
votes
1 answer
@method_decorator(csrf_exempt) NameError: name 'method_decorator' is not defined
I was following the following guide (https://abhaykashyap.com/blog/post/tutorial-how-build-facebook-messenger-bot-using-django-ngrok) on how to create a chatbot, until the part where I updated the views.py. There seems to be some issue with the…

iteong
- 715
- 3
- 10
- 26
7
votes
1 answer
Why can a method be declared to throw many exceptions even if none of them are thrown?
I was merging my source code with that of a colleague and I saw he had added an exception to be thrown in the declaration of a method; however, I knew, that exception would never be really thrown from that method.
I wonder why the compiler did not…

Pedro García Medina
- 407
- 4
- 9
6
votes
2 answers
static imports method overlap
if you have a class with a static import to java.lang.Integer and my class also has a static method parseInt(String) then which method will the call parseInt("12345") point to?
Thanks in Advance!

MozenRath
- 9,652
- 13
- 61
- 104
6
votes
3 answers
Can a Ruby method accept either a block OR an argument?
I'm doing the lessons on The Odin Project and now I have to write myself a new #count method (with another name) that behaves like the normal one from the Enumerable module.
The documentation on count says the following…

Nikolay D
- 329
- 3
- 11
6
votes
5 answers
Java multiple variable length argument
I have not seen the particular thing before today when working on variable length argument
For e.g., There is a method named prepared statement with declaration such that
1.
String prepareStatement(String... columnNames,String... values)…

Akhil Jain
- 13,872
- 15
- 57
- 93
4
votes
2 answers
Passing 'self' parameter during methods decorating in Python
I want to create decorator that shows which parameters were passed to function and methods. I have already written the code for functions, but methods are giving me a headaches.
This is function decorator that works as intended:
from functools…

Maciek
- 463
- 8
- 22
4
votes
3 answers
new() keyword at the end of method declaration
A workmate just gave me some C# classes that I must use in a .NET application.
There's a typo that I have never seen, and I can't found any explication on the internet...
Here's the code :
public void GoTo() where TView : Form, new()
{
…

Scaraux
- 3,841
- 4
- 40
- 80
4
votes
1 answer
Declaration of a method with __attribute__((nonnull(2)))
What does this __attribute__((nonnull(2))) mean in the following method declaration?
- (void)requestShareWithObjectId:(NSString *)object
completion:(void (^)(NSString *likes, NSString *reposts))completion…

user3574157
- 79
- 1
- 4
4
votes
2 answers
C++/CLI : How to override Equal method of Object class
I am a newbie to C++/CLI and is having some problems trying to override the Equal method of the base Object class. I get the following compilation warning error for the following code. How should this be corrected?
Warning 1 warning C4490:…

KK.
- 77
- 2
- 5
3
votes
1 answer
.java Report Generation, Method Caller & Callee
Hello to the most helpful community on the internet!
I'm working on a project that can read a .java file and spit out data. One of my programs to extract data is not working exactly how I intend it work (very cliche). It parses through all the .java…

kalame04
- 75
- 7
2
votes
3 answers
Understanding this use of "(Private)" in @interface declaration
I've seen some code written this way:
@interface AViewController(Private)
I wanted to know if that (Private) means something when submitting to the App Store? What does it mean in general?

pmerino
- 5,900
- 11
- 57
- 76
2
votes
2 answers
Eclipse Formatter: How to avoid indentation of method declaration after annotation?
I have a method declaration with an annotation that is formatted by Eclipse Mars as follows:
@Override
void addLoadShiftingConstraints() throws NoSuchDataException {
//method body
}
I would like to not indent the method…

Stefan
- 10,010
- 7
- 61
- 117