2013年12月9日 星期一

模仿官方版的註解格式,就可以在右邊的quick helper看到註解

手寫的註解
/*!
 *  @method swap:
 *
 *  @param s Uint16 value to byteswap
 *
 *  @discussion swap byteswaps a UInt16 
 *
 *  @return Byteswapped UInt16
 */

-(UInt16) swap:(UInt16)s {
    UInt16 temp = s << 8;
    temp |= (s >> 8);
    return temp;

}


官方版的註解
/*!
 *  @method writeValue:forCharacteristic:type:
 *
 *  @param data The value to write.
 *  @param characteristic The characteristic whose characteristic value will be written.
 *  @param type The type of write to be executed.
 *
 *  @discussion Writes <i>value</i> to <i>characteristic</i>'s characteristic value. If the <code>CBCharacteristicWriteWithResponse</code>
 * type is specified, {@link peripheral:didWriteValueForCharacteristic:error:} is called with the result of the write request.
 *
 *  @see peripheral:didWriteValueForCharacteristic:error:
 * @see CBCharacteristicWriteType
 */
- (void)writeValue:(NSData *)data forCharacteristic:(CBCharacteristic *)characteristic type:(CBCharacteristicWriteType)type;

沒有留言:

張貼留言