Tag: nstextview

如何将NSTextView的格式化内容转换为string

我需要将Mac应用程序中的NSTextView内容传输到iOS应用程序。 我使用XML作为传输的文件格式。 所以我需要将NSTextView(文本,字体,颜色atd)的内容保存为一个string。 有没有办法如何做到这一点?

'sizeWithFont:constrainedToSize:lineBreakMode:'已弃用:

在Xcode 5上将项目从iOS5.0转换为iOS7 / iOS6。下面的代码给出了一个编译时间警告: 'sizeWithFont:constrainedToSize:lineBreakMode:'已弃用:首先在ios 7.0中弃用 – 使用 – boundingRectWithSize:options:attribiutes:context – (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { self.lblHidden.frame = CGRectMake(58, 228, 945, 9999); self.lblHidden.text = detailShareObj.pDesc; CGSize size = [detailShareObj.pDesc sizeWithFont:self.lblHidden.font constrainedToSize:self.lblHidden.frame.size lineBreakMode:NSLineBreakByWordWrapping]; return 228.0+size.height+20; } else if (indexPath.section == 1) { NSString *tempPointStr = (self.shortDescArray)[indexPath.row]; self.lblHidden.frame = CGRectMake(58, 0, 945, […]