Inherits from NSObject
Conforms to JSMessageData
NSCoding
NSCopying
Declared in JSMessage.h

Overview

A JSMessage object represents a single user message. This is a concrete class that implements the JSMessageData protocol. It contains the message text, its sender, and the date that the message was sent.

Tasks

  •   text

    The body text of the message. The default value is the empty string @" ". This value must not be nil.

    property
  •   sender

    The name of user who sent the message. The default value is nil.

    property
  •   date

    The date that the message was sent. The default value is nil.

    property
  • – initWithText:sender:date:

    Initializes and returns a message object having the given text, sender, and date.

Properties

date

@property (strong, nonatomic) NSDate *date
Discussion

The date that the message was sent. The default value is nil.

Declared In

JSMessage.h

sender

@property (copy, nonatomic) NSString *sender
Discussion

The name of user who sent the message. The default value is nil.

Declared In

JSMessage.h

text

@property (copy, nonatomic) NSString *text
Discussion

The body text of the message. The default value is the empty string @" ". This value must not be nil.

Declared In

JSMessage.h

Instance Methods

initWithText:sender:date:

- (instancetype)initWithText:(NSString *)text sender:(NSString *)sender date:(NSDate *)date
Discussion

Initializes and returns a message object having the given text, sender, and date.

Parameters

text

The body text of the message.

sender

The name of the user who sent the message.

date

The date that the message was sent.

Return Value

An initialized JSMessage object or nil if the object could not be successfully initialized.

Declared In

JSMessage.h