Solved

iPhone app training

Posted on 2013-01-08
6
307 Views
Last Modified: 2013-01-10
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
Comment
Question by:KANEWONG
  • 3
  • 2
6 Comments
 
LVL 14

Assisted Solution

by:binaryevo
binaryevo earned 130 total points
ID: 38758332
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
 
LVL 11

Accepted Solution

by:
Deepak Lakkad earned 130 total points
ID: 38758663
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
 
LVL 1

Author Comment

by:KANEWONG
ID: 38762008
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 11

Expert Comment

by:Deepak Lakkad
ID: 38762089
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
 
LVL 1

Author Comment

by:KANEWONG
ID: 38765876
no error found.

tried to press F6 but no help
0
 
LVL 1

Author Comment

by:KANEWONG
ID: 38765896
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The release of the iPhone 6 and the iPhone 6 Plus was extremely successful for Apple. However when iOS 8.1 was introduced, many iPhone users complained of quick battery drainage. Without even knowing, you may be unnecessarily using up your battery p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question