0
我想將ImageAttachement的filePath保存在Core Data中。NSString cut - 核心數據中NSString的長度 - Objective-C iOS 3.2
addNewImageAttachementWithFilePath方法創建一個新的ImageAttachement並將其註冊到Core Data。
現在我遇到了在設置imageAttachement的文件路徑時剪切文件路徑的問題。
- (void) addNewImageAttachmentWithFilePath:(NSString *)filepath
{
ImageAttachment *imageAttachment = [NSEntityDescription insertNewObjectForEntityForName:@"ImageAttachment"
inManagedObjectContext:[self managedObjectContext]];
imageAttachment.filePath = [NSString stringWithString:filepath];
[self addAttachmentsObject:imageAttachment];
}
該文件路徑是正確的。 當我將imageAttachement.filePath設置爲文件路徑時,字符串的其餘部分被剪切。
感謝您的幫助。