Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableDictionary using call method



On 3/4/05 10:55 PM, "Tetsuro KURITA" <email@hidden> wrote:

> hnaks for your replay.
> 
>> I think the syntax for call method requires that parameters get passed
>> inside of braces. Your first line then should be:
>> 
>> set theDict to call method "dictionaryWithCapacity: of class
>> "NSMutableDictionary" with parameter {10}
> 
> I try as follows. But problem is not solved.
> 
> set theDict to call method "dictionaryWithCapacity:" of class
> "NSMutableDictionary" with parameter {10}

dictionaryWithCapacity: takes an unsigned integer (such as 10) as its
argument. So call method  "dictionaryWithCapacity:" requires an integer
(such as 10) as its parameter. That would be:

    set theDict to call method "dictionaryWithCapacity:" of class
"NSMutableDictionary" with parameter 10

You're using a single parameter but for some reason put it into list braces
as {10}. So you sent a _list_, not an unsigned integer, as the parameter.
I'm sure that's the problem. Only use a list when using the 'with
parameters' (plural) version for multiple arguments. (And there's one
special case: if the Obj-C Method argument takes a boolean you need to use
the plural 'with parameters' an send a list like 'with parameters {true}'.
That does not apply in this case, which takes an integer.)


> call method "setValue:aKey:" of theDict with parameters {"hello", "hey"}
> set theDescription to call method "description" of theDict
> log theDescription -- the result of this log statement is "()"

See if it works 'with parameter 10'.




-- 
Paul Berkowitz


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Re: NSMutableDictionary using call method (From: Tetsuro KURITA <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.