Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Objective-C methods are designed to be self documenting, and they borrow from the rich tradition of Smalltalk.</p> <p>I'll try to explain what you have here, <code>-(NSInteger) pickerView:(UIPickerView*)pickerView numberOfRowsInComponent:(NSInteger)component</code>.</p> <ul> <li><p><code>- (NSInteger)</code><br> This first portion indicates that this is an Objective C <strong>instance</strong> method that returns a NSInteger object. the <code>-</code> (dash) indicates that this is an <strong>instance</strong> method, where a <code>+</code> would indicate that this is a <strong>class</strong> method. The first value in parenthesis is the return type of the method. </p></li> <li><p><code>pickerView:</code><br> This portion is a part of the <strong>message name</strong>. The <strong>full message name</strong> in this case is <code>pickerView:numberOfRowsInComponent:</code>. The Objective-C runtime takes this method information and sends it to the indicated receiver. In pure C, this would look like<br> <code>NSInteger pickerView(UIPickerView* pickerView, NSInteger component)</code>. However, since this is Objective-C, additional information is packed into the message name. </p></li> <li><p><code>(UIPickerView*)pickerView</code><br> This portion is part of the <strong>input</strong>. The input here is of type <code>UIPickerView*</code> and has a local variable name of pickerView. </p></li> <li><p><code>numberOfRowsInComponent:</code><br> This portion is the second part of the <strong>message name</strong>. As you can see here, message names are split up to help indicate what information you are passing to the receiver. Thus, if I were to message an object myObject with the variables foo and bar, I would type:<br> <code>[myObject pickerView:foo numberOfRowsInComponent:bar];</code><br> as opposed to C++ style:<br> <code>myObject.pickerView(foo, bar);</code>.</p></li> <li><p><code>(NSInteger)component</code><br> This is the last portion of the <strong>input</strong>. the input here is of type <code>NSInteger</code> and has a local variable name of component.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload