PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, July 12, 2022

[FIXED] How to write a method/message with multiple parameters?

 July 12, 2022     messages, methods, objective-c, parameters     No comments   

Issue

How do you write a method/message with multiple parameters?

EDIT: Like multiple parameters for a single method/message, I mean.


Solution

You can write the declaration as such:

- (void) drawRoundedRect:(NSRect)aRect inView:(NSView *)aView withColor:(NSColor *)color fill:(BOOL)fill

The subsequent call (with 4 parameters) could look like:

[self drawRoundedRect:rect inView:self withColor:[NSColor greenColor] fill:YES];

where rect is a previously defined NSRect, self is the NSView the method is called from, an NSColor object obtained from a nested method call, and the constant boolean value YES.



Answered By - Jeff Hellman
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing