Issue while adding 'Cc' Field in 'TTMessageController' (Three 20)

Posted by Deepika on Stack Overflow See other posts from Stack Overflow or by Deepika
Published on 2010-06-16T11:22:47Z Indexed on 2010/06/18 9:23 UTC
Read the original article Hit count: 339

Hi All

I am using the TTMessageController class for compose mail.There is only 'To' recepients Field in this class. I added the Cc Field in it. I have used this code:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
  if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
    _fields = [[NSArray alloc] initWithObjects:
               [[[TTMessageRecipientField alloc] initWithTitle: TTLocalizedString(@"To:", @"")
                                                      required: YES] autorelease],  
               [[[TTMessageRecipientField alloc] initWithTitle: TTLocalizedString(@"Cc:", @"")
                                                      required: YES] autorelease],  
               [[[TTMessageSubjectField alloc] initWithTitle: TTLocalizedString(@"Subject:", @"")
                                                    required: NO] autorelease],
               nil];

    self.title = TTLocalizedString(@"New Message", @"");

    self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]
                                              initWithTitle: TTLocalizedString(@"Cancel", @"")
                                              style: UIBarButtonItemStyleBordered
                                              target: self
                                              action: @selector(cancel)] autorelease];
    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
                                               initWithTitle: TTLocalizedString(@"Send", @"")
                                               style: UIBarButtonItemStyleDone
                                               target: self
                                               action: @selector(send)] autorelease];
    self.navigationItem.rightBarButtonItem.enabled = NO;
  }

  return self;
}

When I type anything in 'To' or 'Cc' field , two lists are appearing as search result:- One for 'To' field and second for 'Cc' Field. I want to show only one list according to 'To' or 'Cc' Field.

Please suggest me any idea how can I resolve it or some other better way to implement my requirements?

Thanks
Deepika

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c