我正在开发一个阅读文本内容的应用程序。在那个阅读器中,我需要像 iBooks 一样的便笺功能。我想将这些笔记保存在我的设备中。如何保存输入的文本内容?以及如何再次重新打开输入的文本(即)在哪里/如何存储输入的文本?
UIMenuItem *item = [[[UIMenuItem alloc] initWithTitle: @"Wikipedia" action: @selector(wiki:)] autorelease];
UIMenuItem *item1 = [[[UIMenuItem alloc] initWithTitle: @"Dictionary" action: @selector(dict:)] autorelease];
UIMenuItem *item2 = [[[UIMenuItem alloc] initWithTitle: @"Highlight" action: @selector(highlighting:)] autorelease];
UIMenuItem *item3 = [[[UIMenuItem alloc] initWithTitle: @"Notes" action: @selector(noteMaking:)] autorelease];
[menuController setTargetRect:CGRectMake(100, 100, 320, 100) inView:self.view];
[menuController setMenuVisible:YES animated:YES];
[menuController setMenuItems: [NSArray arrayWithObjects: item,item1,item2,item3,nil]];
-(void) noteMaking:(id) sender
{
notes = [[UITextView alloc] initWithFrame:CGRectMake(100, 100, 620, 520)];
notes.text = @"";
notes.scrollEnabled = YES;
[self.view addSubview:notes];
}