이것은 내 NSObject 코드입니다.메일 보내기 TableView NSArray
Task.h
#import <Foundation/Foundation.h>
@interface Task : NSObject
@property (nonatomic,strong) NSString *name;
@property (nonatomic,assign) BOOL done;
-(id)initWithName:(NSString *)name done:(BOOL)done;
@end
Task.m
#import "Task.h"
@implementation Task
@synthesize name = _name;
@synthesize done = _done;
-(id)initWithName:(NSString *)name done:(BOOL)done {
self = [super init];
if (self) {
self.name = name;
self.done = done;
}
return self;
}
이 내 메일 보내기 코드
모르겠어요Task *task = [[Task alloc]init];
MFMailComposeViewController *sendmail = [[MFMailComposeViewController alloc]init];
[sendmail setMailComposeDelegate:self];
NSString *message = [_tasks addObject:task]; // Error is here.
[sendmail setMessageBody:message isHTML:NO];
[sendmail setSubject:@"Test"];
[self presentViewController:sendmail animated:YES completion:nil];
, 그것은 작업을 수행하는 방법. 나는 그 편지를 우편으로 보내고 싶다. 내 실수는 어디 갔지? 어떻게 해결할 수 있습니까?
Tasklistviewcontroller.m
@synthesize tasks = _tasks;
내가 작업 테이블보기에서 전송하고 있습니다.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *NotDoneCellIdentifier = @"NotDoneTaskCell";
static NSString *DoneCellIdentifier = @"DoneTaskCell";
Task *currentTask = [self.tasks objectAtIndex:indexPath.row];
NSString *cellIdentifier = currentTask.done ? DoneCellIdentifier : NotDoneCellIdentifier;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
// Configure the cell...
cell.textLabel.text = currentTask.name;
return cell;
}
출처가 불완전합니다. '_tasks' 란 무엇입니까? –
이것은 테이블 뷰와 어떤 관련이 있습니까? – rmaddy
코드가 변경되었습니다. – Salieh