How to clear the object reference is required error? the script which i am using is coming up with the error that an object reference is required though i am trying to eliminating it by making it static but it isn't working out. can anyone please help me out? do anyswer quickly because i have to finish up this project and move on. the image shows my script which is having the error object reference is required. can anyone help me clear that error please?
Asked
Active
Viewed 55 times
-6
-
Possible duplicate of [An object reference is required for the nonstatic field, method, or property on a Windows form](http://stackoverflow.com/questions/498400/an-object-reference-is-required-for-the-nonstatic-field-method-or-property-on) – Jim Nov 20 '16 at 14:37
-
3*do anyswer quickly because i have to finish up this project and move on* == downvote and delete question as **quickly** as possible. – Jim Nov 20 '16 at 14:39
-
1@Jim: I apologize it took so long to have me do the deed ;-) – zx485 Nov 20 '16 at 21:34
-
@zx485 ;) no worries – Jim Nov 20 '16 at 23:10
1 Answers
-1
As indicated error message, UDPCom.sendLTDimples
is non static function. So you will have to create a new object of class UDPCom
and then using that object call the function.
UDPCom obj = new UDPCom();
Obj.sendLTDimples();

Pratik Gaikwad
- 1,526
- 2
- 21
- 44
-
-
-
1It's probably better to not answer such rude questions. It's better for the OP, since it would be an opportunity to learn from his misbehavior. Now, when he got an answer, he will most probably repeat his behavior next time, since he sees, that it's working for him. – David Ferenczy Rogožan Nov 20 '16 at 20:10
-
sorry i have no clue why the down vote i haven't voted at all and dawid, bro there wasn't any misbehaviour from my side thanks – Muhammad Arsalan Jalees Abro Nov 23 '16 at 12:57
-
and @PratikGaikwad that vote is cast by someone else cause my votes arent shown – Muhammad Arsalan Jalees Abro Nov 23 '16 at 12:59
-
@MuhammadArsalanJaleesAbro if this helped you why don't you accept it as an answer? – Pratik Gaikwad Nov 23 '16 at 14:47
-
honestly am new here so i don't really know how to but it really did help and thank you loads @PratikGaikwad – Muhammad Arsalan Jalees Abro Nov 23 '16 at 21:35