views:

322

answers:

2

I have an Entity (Article) with an Class defined at xcdatamodel. In this class i defined an String NSString *test;

currentArticle.test = string;

String is more than 50 characters long.

But when i try to fetch the Stored Object with:

Article *article = [fetchedResultsController objectAtIndexPath:indexPath];

then article.test is truncated (50 Characters long). But it should be longer...

Any ideas?

+3  A: 

I guess you try to load to the TableView, and it is by default truncated to fit the screen width of the table view.

Put a breakpoint on the line that access the article and see its' value.

Otherwise, you may want to print it out to the console

NSLog(@"my article test string is: %@", article.test);

Edited:

Another note is that your data model may fix the "Max Length" property to 50.

sfa
No also on NSLog the String is truncated
x2on
Can you edit your question with some more codes, at least on the part to set the string variable and the part to get the variable value, or show us your model of the article.
sfa
Hm now it works, but i have no idea why...
x2on
+3  A: 

I've just noticed the same.

As far as I can tell, when logging an NSManaged Object (or a core data error), only the first 50 or so characters of a string attribute are printed. But the actual attribute still has all the characters.

teehemkay