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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 02-05-2012, 11:22 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 31
jollyrgr is on a distinguished road
Default Not able to see nsnumber in storyboard

@property (strong, nonatomic) Pictures *currentPicture;

@property (strong, nonatomic) IBOutlet UITextField *titleField;
@property (strong, nonatomic) IBOutlet UITextField *descriptionField;
@property (strong, nonatomic) IBOutlet UIImageView *imageField;

@property (strong, nonatomic) IBOutlet NSNumber *height;
@property (strong, nonatomic) UIImagePickerController *imagePicker;

&

@synthesize managedObjectContext;
@synthesize currentPicture;
@synthesize titleField, descriptionField, imageField;
@synthesize imagePicker;
@synthesize height;
------------------------------------

Why cant I see an outlet for the number "height" in the storyboard?
jollyrgr is offline   Reply With Quote
Old 02-05-2012, 01:31 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

NSNumber is not a visual object. That wouldn't make any sense. What are you trying to do?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 02-06-2012, 10:35 PM   #3 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 31
jollyrgr is on a distinguished road
Default

I made an new "integer 16" entity in core data called "height". I then had core data create a subclass. The entity "height" came up in the subclass as "@property (nonatomic, retain) NSNumber * height;".

I created an outlet by dragging from a "text field" in my storyboard into my "Bedrooms" m-class and it created "@property (strong, nonatomic) IBOutlet UITextField *height;".

I am just trying to hook up: "@property (nonatomic, retain) NSNumber * height;". to: "@property (strong, nonatomic) IBOutlet UITextField *height;"

I dont know why this is so hard for me. Some things are easy others are hard. Help would be great and I will toast a shot of great tequila to you if you can help me!

Thanks Mr. Slick!!!!
Jollyroger
jollyrgr is offline   Reply With Quote
Old 02-07-2012, 08:13 AM   #4 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

That's not a connection you can make graphically. Text fields accept NSStrings, not NSNumbers. So you will need to take your number and format it as a string in code, then supply that string to the text field.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 02-07-2012, 10:33 AM   #5 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 31
jollyrgr is on a distinguished road
Default

So I need to transform the "integer 16" number and transform it to a string, not sure how to do that. Perhaps it is easier to store them as a string in core data, enter them as a string in the interface and then manipulate them as a number when ever I need to do calculations.

I will research how to transform a string into a number. Working with integers in xcode is not easy. Strings and pictures are however. Perhaps core data is not suppose to be used for numbers.

All I want to do is store, display and manipulate an integer that has been entered in a textfield, now I have to find out how to transform the numbers to strings.

Anything you could do for me to help me get a number from the interface into core data would be great.
jollyrgr is offline   Reply With Quote
Old 02-07-2012, 10:57 AM   #6 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

It does not matter what you use in Core Data for this; it is not something that can be graphically done. There is going to be code involved, no matter what.

Text fields work with strings. If the text field is only supposed to contain digits, then those digits will be treated as a string. If this is on the iPhone, this is easily enforced by using the number pad keyboard. If this is the iPad, then you are going to have to take steps to make sure that letters are not entered. There is going to be work involved.

As far as how you store it in Core Data, do you need it to be a numerical value, or do you only need a string? Are you going to be doing math with it? Are you going to want to format it in different ways, such as currency? If so, then you probably want the number. If not, then a string is probably sufficient.

It doesn't really matter, because ultimately you can switch back and forth as necessary. NSString has methods such as intValue and floatValue that can be used to extract primitive numbers from strings. NSNumber has methods that allow you to construct NSNumber objects from those primitive values.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 02-07-2012, 11:44 AM   #7 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 31
jollyrgr is on a distinguished road
Default

I thought that there would be an easy way to connect "@property (strong, nonatomic) IBOutlet NSNumber *height;" created by core data, to an IB textfield "height" that will display that value, let the user change it and store it back into core data.

I know there will be code involved, I just want to learn how to code it. I can store pictures, dates, and words, but from what I understand here and in the 1,000 tutorials I have read it is going to take some real heavy lifting and lots of work to force core data to work with the interface in Nib or storyboard to use simple numbers. I understand that and I am willing to do research with anyone that understands this problem.

I just cant believe that it is easier to store pictures than get a two digit number from the interface to core data. But if it takes 1,000 like of code to get this done, I guess I will have to do it.

Thanks Mr. Slick, Off to the books for me.

Respectfully
jollyroger
jollyrgr is offline   Reply With Quote
Old 02-07-2012, 11:47 AM   #8 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 31
jollyrgr is on a distinguished road
Default

Whoops, I meant connect "@property (nonatomic, retain) NSNumber * height;" to a textfield in IB and store it back to core data, my mistake.
jollyrgr is offline   Reply With Quote
Reply

Bookmarks

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: 405
18 members and 387 guests
Apptronics RBC, Atatator, chiataytuday, dre, FrankWeller, gwelmarten, ipodphone, jeroenkeij, jleannex55, kukat, LunarMoon, MAMN84, n00b, pbart, reficul, Retouchable, Sami Gh, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,124
Posts: 402,909
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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