如何访问NSMutable Array中的自定义对象字段?

mil*_*lof 0 iphone ios

我有一个自定义对象,如:

 #import <Foundation/Foundation.h>


    @interface FaxRecipient : NSObject {


        NSString * contactID;
        NSString * name;
        NSString * fax;
        NSString * company;
        NSString * phone;

    }
    @property(nonatomic,retain)NSString *contactID;
    @property(nonatomic,retain)NSString *name;
    @property(nonatomic,retain)NSString *fax;
    @property(nonatomic,retain)NSString *company;
    @property(nonatomic,retain)NSString *phone;

    @end
Run Code Online (Sandbox Code Playgroud)

我有一个包含FaxRecipient对象的NSMutableArray(remoteRecipientItems)数组.

但是,我试图通过使用名称设置UITableView单元格的值:

[[cell textLabel]setText:[remoteRecipientItems objectAtIndex:[indexPath row]]]; //I want to only use the name value of FaxRecipient. Sorry for the newbie question.
Run Code Online (Sandbox Code Playgroud)

Sun*_*uny 5

FaxRecipient *faxObject= [remoteRecipientItems objectAtIndex:indexPath.row];//This is ur object
cell.textLabel.text=faxObject.name;//this sets the name
Run Code Online (Sandbox Code Playgroud)