Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-30-2009, 03:25 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 2
Default String field of a model object truncated to 50 characters?

I've got a model object which has a string property that I'm trying to set to some string with a length > 50, but it's always cut off at 50 characters. This includes all string properties of this particular model object. I've verified that the string I'm assigning the model property isn't being truncated before hand...it is truncated on assignment. Has anyone else experienced this behavior? Thanks

Also, I've got the Min and Max length properties in the Model file for that attribute set to 0 and 300 respectively, but it doesn't seem to make a difference.

Last edited by jtrimble; 09-30-2009 at 03:34 PM. Reason: Added Information
jtrimble is offline   Reply With Quote
Old 09-30-2009, 04:35 PM   #2 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 2
Default

Quote:
Originally Posted by jtrimble View Post
I've got a model object which has a string property that I'm trying to set to some string with a length > 50, but it's always cut off at 50 characters. This includes all string properties of this particular model object. I've verified that the string I'm assigning the model property isn't being truncated before hand...it is truncated on assignment. Has anyone else experienced this behavior? Thanks

Also, I've got the Min and Max length properties in the Model file for that attribute set to 0 and 300 respectively, but it doesn't seem to make a difference.
Wow, that's embarrassing....

I was using gdb printobject to print the model object to the console before I did any actual database commits. It turns out that gdb was only printing the first 50 characters of the attributes in the model object. I decided to go ahead and save the value to the database, and it saved the entire string, no truncation. oh well...lesson learned. Don't believe everything gdb tells you
jtrimble is offline   Reply With Quote
Reply

Bookmarks

Tags
characters, cutoff, fifty, nsstring, truncate

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 249
14 members and 235 guests
ADY, CKAmike, Dani77, dessicant, Duncan C, HemiMG, jakerocheleau, nick.keroulis, Promo Dispenser, Punkjumper, Rudy, sacha1996, sneaky, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,231
Posts: 380,768
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:23 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0