• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

iPhone app training

Hi;

I am learning to code a simple iPhone app but I got stuck, pls help to solve my problem.

Suppose, when I type my message in the text box and press the "Press Here" button, it should show what I typed in the "label" area but it did not.

It stopped at the breakpoint.  Pls see my snapshot.
Screen-Shot-2013-01-08-at-11.02..png
0
KANEWONG
Asked:
KANEWONG
  • 3
  • 2
2 Solutions
 
binaryevoCommented:
It appears that you have everything setup correctly.  Hmmmm, the problem most likely resides with that UILabel not being wired up correctly in interface builder.  Are you using storyboards or xibs?  That does determine how you set it up.


Xib wireup:  http://bynomial.com/blog/?p=5
Storyboard wireup: http://klanguedoc.hubpages.com/hub/IOS-5-A-Beginners-Guide-to-Storyboard-Connection

Hope this helps
0
 
Deepak LakkadCommented:
add following code

@synthesize textBox;
@synthesize label;

after

@implementation ViewController

And change following line of code

NSString *Output = Nil;

with

NSString *Output;

I think this will solve the problem

- Deepak Lakkad
0
 
KANEWONGAuthor Commented:
Hi;

per Deepak instruction, I add two commands to declare textBox and label

@synthesize textBox;
@synthesize label;

also, I have tried the xib wire up

but still no luck.file owner
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Deepak LakkadCommented:
Do you get any error message?

If yes, what is that?

If No, Just stopped on breakpoint - Press F6 to execute next step

- Deepak Lakkad
0
 
KANEWONGAuthor Commented:
no error found.

tried to press F6 but no help
0
 
KANEWONGAuthor Commented:
OK.

after changing (bool) to (BOOL) as below, my simple app work as expected with your guys suggestion.

- (BOOL)textFieldShouldReturn:(UITextField *)theTextField{
    [textBox resignFirstResponder];
    return YES;
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now