Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JoshAK

macrumors newbie
Original poster
Aug 12, 2008
19
0
When I am saving data form a UITextView to a plist the data is saved except the last letter typed into the UITextView. I'm using:

Code:
NSMutableArray *array = [[NSMutableArray alloc} init];
[array addObject:objectname];
[array addObject:objectname2];
[array addObject:objectname3];
//ect
[array writeToFile:[self noteFile1] atomically:YES];
[aaray release];

Everything is saved except the last charter in the text field. Is the a bug or does someone else know the reason?

Thanks,

Josh
 

jnic

macrumors 6502a
Oct 24, 2008
567
0
Cambridge
Have you checked the content of the array to ensure that all characters are being passed into it in the first place?

Also, I assume this typo isn't in the actual code:

Code:
[[NSMutableArray alloc} init];
 

JoshAK

macrumors newbie
Original poster
Aug 12, 2008
19
0
Have you checked the content of the array to ensure that all characters are being passed into it in the first place?

Also, I assume this typo isn't in the actual code:

Code:
[[NSMutableArray alloc} init];

Yes that is a typo. What is the best way to check the content of the array?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.