• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Fw: passing 2 parameters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fw: passing 2 parameters


  • Subject: Fw: passing 2 parameters
  • From: Evan Schoffstall <email@hidden>
  • Date: Mon, 07 Nov 2011 17:23:14 -0500

Forgot to forward to the whole list.

-- 
Evan Schoffstall
Sent with Sparrow

Forwarded message:

From: Evan Schoffstall <email@hidden>
To: droom departement <email@hidden>
Date: Monday, November 7, 2011 11:31:46 AM
Subject: Re: passing 2 parameters

Unfortunately, your doing this all wrong.


See the following:


script AppDelegate

property parent : class "NSObject"

on applicationWillFinishLaunching_(aNotification)

AppDelegate's doSomethingWith_andThis_("Hello", "World")

        AppDelegate's doSomethingWithVaribale_andThisOtherVariable_AndAnotherVariable_("Hello", "World","!")

end applicationWillFinishLaunching_

on applicationShouldTerminate_(sender)

return current application's NSTerminateNow

end applicationShouldTerminate_

on doSomethingWith_andThis_(variable1, variable2)

display dialog variable1 & variable2

end doSomethingWith_andThis_

    on doSomethingWithVaribale_andThisOtherVariable_AndAnotherVariable_(variable1, variable2,variable3)

        display dialog variable1 & variable2 & variable3

    end

    

end script



Note A few things. 
1) The Underscores" _ " note where the variables in the parentheses go. The first variable to the first underscore etc. 
2) The text behind the underscore cannot be duplicated like the following:

AppDelegate's doSomethingWith_andThis_andThis("Hello","World","!")


3) Also, this cannot be run in the Applescript editor. Try Xcode if you really want to verify the result and play around with it.


-- 
Evan Schoffstall
Sent with Sparrow

On Monday, November 7, 2011 at 8:58 AM, droom departement wrote:

Thank you Evan,
I will give it a try,
Right now I could run around this issue by doiing:

tell myRefToSQLObj to insertToDB01__(test1, test2)

I just putted 2 'underscores' when I called the method. Not very 'human readable', don't even know if this couldn't be a problem later on.


And how should I formulate it when I want to pass - let's say - 5 parameters ?

-(void) insertAValue:(NSString *)fieldValue0 withAnotherValue:(NSString *) fieldValue1 withAnotherValue:(NSString *)fieldValue2...


Regards,

Droom


2011/11/6 Evan Schoffstall <email@hidden>
More specifically there is no selector [dbViewController insertToDB01:p2:] as xCode is right to complain about such. 

-- 
Evan Schoffstall
Sent with Sparrow

On Sunday, November 6, 2011 at 11:54 AM, droom departement wrote:

I'm calling a method from another class and like to pass multiple parameters.
Passing 1 parameter is no problem, adding the second one turns out in a 

-[dbViewController insertToDB01:p2:]: unrecognized selector sent to instance 0x2000c18a0

2011-11-06 17:40:28.540 myLittleBook[2083:a0f] *** -[imageSorting hStoreText:]: -[dbViewController insertToDB01:p2:]: unrecognized selector sent to instance 0x2000c18a0 (error -10000)


my code snippit:

on hStoreText_(sender)

tell class "NSString" of current application to set test1 to its stringWithString_(test1Str)

tell class "NSString" of current application to set test2 to its stringWithString_(test2Str)


tell myRefToSQLObj to insertToDB01_p2_(test1, test2)

end hStoreText

called method

-(void) insertToDB01:(NSString *) fieldValue0:(NSString *) fieldValue1 {


NSLog(@"phase1");

}


can anyone help me ?



_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)

This email sent to email@hidden




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >passing 2 parameters (From: droom departement <email@hidden>)
 >Re: passing 2 parameters (From: Evan Schoffstall <email@hidden>)

  • Prev by Date: Re: passing 2 parameters
  • Next by Date: Re: [ANN] Update to AppleScriptObjC Explorer, errata for 'AppleScriptObjC Explored'
  • Previous by thread: Re: passing 2 parameters
  • Next by thread: Re: [ANN] Update to AppleScriptObjC Explorer, errata for 'AppleScriptObjC Explored'
  • Index(es):
    • Date
    • Thread