• 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
Re: Newbie: Cannot use object as a parameter to a method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: Cannot use object as a parameter to a method


  • Subject: Re: Newbie: Cannot use object as a parameter to a method
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 22 Apr 2004 21:40:16 +0200

Michael,

On 22.4.2004, at 21:04, Michael S. Tashbook wrote:

> - (NSString)rollAsString;

Object values need to be declared as class pointers. Namely in this
case, you wanted

-(NSString*)rollAsString;

> NSLog(@"Rolled a %d.\n", currValue);

This is pretty unimportant, but you don't need to use \n. NSLog does it
automatically.

> - (NSString)rollAsString
> { // XCode reports the error here

Same as above, "...(NSString*)..." should cure the problem.

Otherwise, the code looks all right.
---
Ondra Hada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Newbie: Cannot use object as a parameter to a method (From: "Michael S. Tashbook" <email@hidden>)

  • Prev by Date: Re: Newbie: Cannot use object as a parameter to a method
  • Next by Date: Re: Loading/Unloading a Cocoa-using framework from a CFM application
  • Previous by thread: Re: Newbie: Cannot use object as a parameter to a method
  • Next by thread: Re: Newbie: Cannot use object as a parameter to a method
  • Index(es):
    • Date
    • Thread