Trouble with first progråµ

I'm having trouble with my simple calculator, which is similar to the calculator in "cocoa programming for dummies".
http://public.me.com/schoolkid144
its firstproject.zip
The trouble is that when I get the value of the two text fields, it always returns 0 even when the value of both text fields is 1.

Hi S-T Programmer, and welcome to the Dev Forums!
The connections between the FuseBox outlets and the three text fields just need to be reversed in Interface Builder. An IBOutlet instance variable is associated with an Interface Builder object by Ctrl-Dragging from the object which owns the variable to the object the variable wants to reference. For example, to connect the FuseBox ivar named answerField to the text field which is to display the answer, Ctrl-Click on the FuseBox icon in the xib window then drag to the desired text field object. The text field object may either be found as an icon in the xib (Document) window, or as the full-scale drawing of the object in the IB Editor window (where you lay out the view). When you release the mouse at the end of the drag, a black list of all the FuseBox class outlets will pop up. Select the outlet you meant to connect (in this case answerField), and the connection will be made.
The problem with giving IB instructions in the forum is that a picture is worth a thousand words, and this post is on the wrong side of that equation. So I'm hoping you'll be able to see enough of the picture from all these words. There are two other ways of making IB connections that are harder to use, but easier to explain:
1) If you Ctrl-Click (without dragging) on any icon in the xib window, a floating, black panel will pop up showing every possible connection to that object. To make the same connection discussed above from the answerField outlet to the right-hand text field, Ctrl-Click on the FuseBox icon and find answerField in Outlet list. You can now drag directly from the connector symbol to the desired text field. This time there's no popup when you release the mouse because IB already knows which outlet is to be connected. After the connection is made, you can Ctrl-Click on the text field icon and see its connection panel. You'll know the connection is going in the right direction when the connection to the text field is listed under +Referencing Outlets+ and the connection back at the FuseBox object is listed under Outlets.
The floating, black connection panels are especially useful for deleting connections. Since your project currently has three backwards connections, you can use these panels to delete those by clicking on the 'X' which is visible on each connection line.
2) There's also a tab in the Inspector window for making connections. Select one of the objects you want to connect and select Tools>Connections Inspector from the top menu if you have trouble finding the tab. You can make connections in this window if you want, but you can also use the Connections Inspector to view the connections previously made by dragging.
This topic is covered in more detail (including some screen shots! yay!!) under Creating and Managing Outlet and Action Connections in the +Interface Builder User Guide+.
I think your connection between the Calculate button and the FuseBox was correct. This post has gotten so long I can't remember if I had to reverse that one too, but I don't think I did. Anyway you'll be able to check for yourself now that you know what to look for, right? The connection between an object's Sent Action and an IBAction method goes in the direction opposite to an IBOutlet connection. Thus to connect the Calculate button you need to drag from the button to the FuseBox.
_Outlet from_ the FuseBox
_Action to_ the FuseBox
Hope that helps!
\- Ray

Similar Messages

  • Having trouble with First Class mail

    I'm trying to use my email at school (Benito Juarez Community Academy) and also set up Gradespeed but having trouble with both.
    In composing mail, the screen will only accept a line or so and no more. I can mail that but message is incomplete. Also, can't get into Gradespeed. All I get is a multicolored pinwheel that is a security check but never stops spinning.

    See this thread: [[/en-US/questions/894442]] OWA 2010/Firefox 8 and ASHX Attachments

  • Trouble with first RMI

    Hi,
    I just have written a simpliest RMI application with a help of a textbook.
    When I run both parts (server & client) on the same machine I get the expected output, but when I tried to run client on another machine - I got
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: SimpleRMIImpl_Stub (no security manager: RMI class loader disabled)
    I guess (no security manager: RMI class loader disabled) is the answer to my problem. But have no idea what with means and what should I do??
    C:\distr>java SimpleRMIClient my_other_machine
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: SimpleRMIImpl_Stub (no security manager: RMI class loader disabled)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Unknown Source)
    at SimpleRMIClient.main(SimpleRMIClient.java:13)
    Caused by: java.lang.ClassNotFoundException: SimpleRMIImpl_Stub (no security m
    ager: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
    at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
    at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
    at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
    at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    ... 3 more
    C:\distr>

    Hello friend,
    I have the same problem have posted above, and I have try all them have showed but no way! so try my self.
    I will write in detail so you can understand our problem. but I am sorry, this is only for Windows
    This is may example from abook:
    Reverse.java file
    import java.rmi.*;
    import java.rmi.server.*;
    public class Reverse extends UnicastRemoteObject implements ReverseInterface
    public Reverse() throws RemoteException
    super();
    public String reverseString(String originalString) throws RemoteException
    int length = originalString.length();
    StringBuffer temp = new StringBuffer(length);
    for (int i = length ; i>0 ; i--)
    temp.append(originalString.substring(i-1,i));
    return temp.toString();
    public static void main(String[] args)
    if (System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());
    //String name = "//jamesh/com.wrox.rmi.Reverse";
    String name = "//localhost/Reverse";
    try
    Reverse r = new Reverse();
    Naming.rebind(name,r);
    System.out.println("Reverse object bound");
    catch (Exception e)
    System.out.println("Error while binding Reverse object");
    System.out.println(e.toString());
    and ReverseInterface.java file
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface ReverseInterface extends Remote
    String reverseString(String originalString) throws RemoteException;
    and there is the client file for testing, Client.java
    import java.rmi.*;
    //import ReverseInterface;
    public class Client
    public static void main(String[] args)
    try
    //ReverseInterface ri = (ReverseInterface) Naming.lookup("//localhost:1099/Reverse");
    ReverseInterface ri = (ReverseInterface) Naming.lookup("//localhost:1099/Reverse");
    String result = ri.reverseString(args[0]);
    System.out.println("The reverse of " + args[0] + " is " + result);
    catch (Exception e)
    System.out.println("Error accessing remote object.");
    System.out.println(e.toString());
    this is .java.police file
    /* AUTOMATICALLY GENERATED ON Tue Jan 13 12:55:40 GMT+07:00 2004*/
    /* DO NOT EDIT */
    grant codeBase "file:${java.home}/lib/ext/*" {
    permission java.security.AllPermission;
    grant {
    permission java.lang.RuntimePermission "stopThread";
    permission java.net.SocketPermission "localhost:1024-", "listen";
    permission java.util.PropertyPermission "java.version", "read";
    permission java.util.PropertyPermission "java.vendor", "read";
    permission java.util.PropertyPermission "java.vendor.url", "read";
    permission java.util.PropertyPermission "java.class.version", "read";
    permission java.util.PropertyPermission "os.name", "read";
    permission java.util.PropertyPermission "os.version", "read";
    permission java.util.PropertyPermission "os.arch", "read";
    permission java.util.PropertyPermission "file.separator", "read";
    permission java.util.PropertyPermission "path.separator", "read";
    permission java.util.PropertyPermission "line.separator", "read";
    permission java.util.PropertyPermission "java.specification.version", "read";
    permission java.util.PropertyPermission "java.specification.vendor", "read";
    permission java.util.PropertyPermission "java.specification.name", "read";
    permission java.util.PropertyPermission "java.vm.specification.version", "read";
    permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
    permission java.util.PropertyPermission "java.vm.specification.name", "read";
    permission java.util.PropertyPermission "java.vm.version", "read";
    permission java.util.PropertyPermission "java.vm.vendor", "read";
    permission java.util.PropertyPermission "java.vm.name", "read";
    permission java.net.SocketPermission "*:1024-65535", "connect,accept";
    permission java.net.SocketPermission "*:80", "connect";
    grant {
    permission java.security.AllPermission;
    =======================end of code==============
    then there is the guide for building this example
    I save my example in:
    ReverseInterface.java file and Reverse.java
    c:\rmiexample
    client.java in c:\rmiexample\test and the policy in c:\rmiexample\policy
    1/Compile all class
    javac *.java
    2/ generate Stub and skeleton
    rmi Reverse
    3/ start RMI registry
    start rmiregistry
    4/execute remode object
    java -classpath c:\rmiexample\ -Djava.rmi.server.codebase=file:/C:\rmiExample\ -Djava.rmi.server.hostname=localhost -Djava.security.manager -Djava.security.policy=file:/C:\rmiExample\policy\.java.policy Reverse
    Reverse object bound
    5/ Run client
    java -classpath c:\rmiexample\test\ Client 123456789
    The reverse of 123456789 is 987654321
    If you system is config well you run it without any problem but, my computer have many problem with JVM, so I have to work very hard to pass this example ;-)
    The first problem is that:
    C:\rmiExample>java -classpath c:\rmiexample\test\ Client qerrewrw
    Error accessing remote object.
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: Reverse_Stub (no security manager: RMI class loader disabled)
    the second error when i change, policy folowing the guide in the book,
    C:\rmiExample>java -classpath c:\rmiexample\test\ Client qerrewrw
    Error accessing remote object.
    java.rmi.UnmarshalException: error unmarshalling return; nested exception
    java.lang.ClassNotFoundException: access to class loader denied
    as you see, I went to java.sun.com, I hope in there will help me pass my problem, but there are many guide, but you know , no thing fix with me... any way thank you very much, about the time you spend on writing the guide
    and there is the last I do myself, chand policy to
    grant {
    permission java.security.AllPermission;
    C:\rmiExample>java -classpath c:\rmiexample\test\ Client 123456789
    The reverse of 123456789 is 987654321
    of course , this is not the good solution, but I just want to show that to make it runfirst and will fine tune later.
    I hope you run all easily...
    vnnWeb.

  • Trouble with first sync

    I have tried many times to sync my phone for the first time.  I make about 50% progress in the backup and that takes about 2 1/2 hours.  Then my computer starts acting up.  I lose control of my mouse and I stop making progress with the sync.  Does anyone have any help to offer?  I want to install an update but I can't until I backup my files and that's where I am stuck.  Thanks!

    Hi and welcome to the forums!
    Check the PC and disable any firewalls or virus protection programs, for the initial sync.
    Once the internet is accessed by the desktop manager software you can run normally.
    Thanks,
    Bifocals
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB16471&sliceId=1&docTy...
    Message Edited by Bifocals on 05-11-2009 05:41 PM
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • Trouble With First Workflow

    This is my first attempt to make a workflow which has more than a couple steps and I cant seem to get it to work. This is for a generic SharePoint 2013 list. I've taken some online tutorials and watched some videos but none of them get me close enough to
    achieve what I'm going for. This is what I want the logic to be:
    When a new item is added by someone (we'll call them person X) begin the workflow.
    Immediately send an email to person Y with the details of the new item added
    wait until the "status" field has been changed
    Send an email to Z if status reads "approved" or "denied". Else (when the condition would read "Request more info") send an email back to X.
    If the approved/denied route is taken the workflow can end there, otherwise I want it to wait until the status field is updated again before the email is finally sent to Z.
    This is what I have in SharePoint Designer:
    When a new item is added the workflow starts and sends the first email however once I've updated the status on the list the workflow status shows it's still on Stage 1 and the workflow stays stuck there. What can I do about this?

    Hi Nathan_R,
    From the workflow steps, it is no strange that the workflow status is still on Stage 1 :).
    If you create a "send an email" work flow, Then it need't to approve/reject. 
    For your issue, create a "Start Approval Process" workflow named "approval" with SharePoint 2010 platform. Then create your SharePoint 2013 Platform workflow, use "Start a list workflow" action to call SharePoint
    2010 platform workflow "approval".
    Refer to the screenshot:
    Or you can create your workfolw in SharePoint 2010 platform, you should instead your first action"Send an email" with "Start Approval Process".
    If you have any other questions , please do not hesitate to let me know. It is my pleasure to be of assistance.
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Troubles with first Gen ipad

    Hello all,
    I just received a first generation ipad and I'm having a few problems with it. The ipad was sitting in an office drawer for a long time. Today, I plugged it into an ipad charger, and it was charging super slow (after about 6 hours, was at 13%).
    I brought it home and plugged it into my new ipad wall wart, and now it doesn't seem to be charging at all. I've tried several cables, and nothing.
    Second issue: It got to the connect to iTunes screen, but my computers won't recognize it. Tried my mini running Lion and also my vista laptop.
    Any suggestions on what might be wrong?

    Have the latest iTunes on windows. Mac still need to update, but its still only one version old.
    I'm sure the port is clean but ill check again tomorrow.
    In the meantime, any other possible solutions?
    Just a little update, it does seem to be charging again when plugged into a wall. Again, it is charging very slowly. Also, when its charging, the battery symbol isn't showing that its charging at all.

  • 1 gb ipod nano - trouble with first time charge?

    I've recently tried to charge my 1gb nano for the first time using my USB hub. I'm running xp w/sp 2...and after plugging the nano into my computer it did nothing. I researched and buying an A/C adaptor was suggusted. I purchased the charger and still nothing. Not a battery icon, a lightning bolt..nothing. I will say when I first plugged the nano in to charge the apple icon came up twice and I haven't seen any signs of life from the thing since then.
    Can anybody help? Prior to my returning or throwing this thing out the window? Maybe technology just isn't ready to properly replace my discman!

    See these or return it and get another one.
    My iPod won't turn on.
    iPod battery doesn't charge.

  • Battery trouble with first ipod!!

    apologies if i have posted in the wrong section...just new.
    have just aquired one of the first ipod models 40gb.
    the battery is lasting for a half hour only!! Is it possible to purchase a new battery?
    any advice/help appretiated...many thanks
    claire

    Have a look at these.
    Beef up my iPod battery.
    How to accurately determine your iPod battery life.
    If it needs a battery replacement you can get one from these people.
    http://www.ipoddoctor.co.uk/
    I don't know of any specifically in Ireland. Maybe a Google will throw something up.

  • Trouble with first conversion

    I just signed up and can't convert a pdf to a Word doc??

    Hi there,
    I apologize for the delayed response.
    Are you still needing assistance?
    Looking forward to hearing back from you.
    Regards, Stacy

  • Trouble with slow Macbook Air. I have first generation MacBook Air and have a hard time keeping hard drive from being full. Right now, I have almost 5 gigs available, but mac is slow and I keep getting color wheel when I use Mail. Any suggestions?

    Trouble with slow Macbook Air. I have first generation MacBook Air and have a hard time keeping hard drive from being full. After trashing many docs, I have almost 5 gigs available, but mac is slow and I keep getting color wheel when I use Mail. I'd like to install Lion, but now I'm afraid it will slow down my machine even further. Do I have enough free hard disc space? Is Mail problem related to free hard disc space? Thanks for your help!

    7gb of free disc space is required to install Lion.  Read this about how to free up disc space: http://pondini.org/OSX/DiskSpace.html.  Also, advice on how to speed up your mac: http://www.maclife.com/article/feature/25_ways_speed_your_mac

  • I've had trouble with my Macbook since the first month I bought it. I've replaced the hard drive 3 to 4 times. Now some programs won't work or shut off by itself. Is it possible to ask for a complete exchange of products?

    I've had trouble with my Macbook since the first month I bought it. I've replaced the hard drive 3 to 4 times. Now some programs won't work or shut off by itself. Is it possible to ask for a complete exchange of products?

    This may help you: http://store.apple.com/us/help/returns_refund
    It would appear that you can ask for an exchange but it doesn't specify any time frame... Hopefully someone more knowledgeable can add to this.
    By the way, if you've replaced the drive so many times, perhaps there's something else going on elsewhere.

  • TS1398 I am having trouble with safari dropping most Internet connections most every time I'm on.  This is a first generation iPad. Can this be cried?

    II am having trouble with safari dropping most Internet connections most every time I'm on.  This is a first generation iPad. Can this be cried?

    This issue was resolved! I didnt think about restoring my computer to factory settings but I did and now my computer works like brand new. basically, just back up your files and do the following:
    http://www.youtube.com/watch?v=yPmT5Xbb8p0

  • TS3276 Hi there I am having trouble with my outlook express this is the first time it has happened it keeps telling me can't connect to the SMTP server and every password I have tried is incorrect this is for 'iCloud' very frustrating as all our phones ar

    Hi there I am having trouble with my outlook express this is the first time it has happened it keeps telling me can't connect to the SMTP server and every password I have tried is incorrect this is for 'iCloud' very frustrating as all our phones are ok

    Well I am feeling a bit silly now because that was all I had to do. In the past Workgroup Manager had always opened right up to the list of my users, I never even thought to click on that but apparently that was all that was needed.
    I still am not sure how the iChat Server preferences changed themselves on me, but it is not the first time I have had weird "settings" issues with our Snow Leopard Server.
    Thanks!

  • I can't move downloads onto my desktop nor can I move folders around desktop. Have been having trouble with iPhoto also. "Terminal" has shown up on my dock for the first time. I tried repairing using disk utilities.

    I can't move downloads onto my desktop nor can I move folders around desktop. Have been having trouble with iPhoto also. "Terminal" has shown up on my dock for the first time. I tried repairing using disk utilities.Please Help!

    I have the same issue-was there ever a solution that worked? Thanks.

  • Anyone having trouble with iCloud?  It first started on my iPhone5; it's not connecting to iCloud.  Tells me I need to reset my password, but won't let me reset my password

    Anyone having trouble with iCloud?  It first started on my iPhone5; it's not connecting to iCloud.  Tells me I need to reset my password, but won't let me reset my password

    All I can suggest is that you open that file on the MBA and save it as a new file, then see if you can open the new one on the iMac.

Maybe you are looking for

  • Amber light won't work, green still does

    I've encountered an odd problem, albeit not that serious. When I first plug my magsafe power adapter in the light on the magnet part turns green, then instead of turning to amber as it previously did it simply goes off. The computer is showing that i

  • How do i get itunes 6.0.4 to "add" mp3s created using itunes 2.0.4?

    clearly, in OS 9 the iTunes 2.0.4 Library data file and iTunes Music folder are in different locations than in OS 10. how does one elegantly 'move' these files so they are recogized by iTunes 6.0.4? i have discovered that by opening each mp3 imported

  • IWeb crashes on launch

    I bought iLife 06 yesterday. Installed it on my dual G5 and tried to launch iWeb. The black triangle blinks for a few seconds in my dock then iWeb quits and I get the "Send to Apple" prompt. It does it consistently every time. I can't even see the me

  • Does digital output conflict with impedance analyzer

    I am running one program that produces three digital outputs on DO [0..2] and I am also trying to run the Impedance analyzer at the same time. I get this error message: Error -200429 occurred at DAQmx Write (Digital 1D Bool 1Chan 1Samp).vi:1 Possible

  • Clear Cache for Items

    Hello again, i`ve made simple process with type "Clear Cache for Items (ITEM,ITEM,ITEM)" and with process point "On Load - Before Header" through wizard, in "Process" field i`ve inserted all items what i want to be clear on page load(from list below)