PDA

View Full Version : xcode example currencyconvertor no can do




paddy learner
Oct 26, 2005, 06:53 AM
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjCTutorial/index.html
the urgency of this problem needing solvig is due to my need to complete a 3rd year college software project in a tight shedule
college based in Dublin Ireland and 99.99% microsoft student tutor envioment so no possibilty to locate semi or expert mac head in college:(


just bought the apple ibook 12 inch tiger 10.4 last week so am a serious newby to mac
The immeadiate requiment is to reproduce the example currencyconvertor in xcode
have completed the gui part but cant figure out this command drag tab munbo jumbo to get the text fields to accept inputs


exact quote of instuctions is below taken from url supplied on top of thread

not figure 2-14 not supplied

Enable Tabbing Between Text Fields
The final step in composing the Currency Converter user interface has more to do with behavior than with appearance. You want the user to be able to tab from the first editable field to the second, and back to the first. Many objects in Interface Builder’s palettes have an outlet named nextKeyView. This variable identifies the next object to receive keyboard events when the user presses the Tab key (or the previous object when Shift-Tab is pressed). A Cocoa application by default makes its “best guess” about how to handle text field tabbing, but this guess often produces unexpected results. If you want correct interfield tabbing, you must connect fields through the nextKeyView outlet:

Select the Exchange Rate text field.

Control-drag a connection from the Exchange Rate text field to the Dollars to Convert text field, as shown in Figure 2-14.


Figure 2-14 Connecting nextKeyView outlets in Interface Builder


In the inspector for the Dollars to Convert text field click Outlets, select nextKeyView, and click Connect. The nextKeyView outlet identifies the next object to respond to events after the Tab key is pressed.

Repeat the same procedure, going from the Dollars to Convert text field to the Exchange Rate text field.

being able to complete this example will alow me to modify it for my project but if I cant do this example by tommorrow I have to abandon this project and go back to the college java enviorment and code line by line say the tutor
:( :(

Paddy



caveman_uk
Oct 26, 2005, 06:59 AM
What it means is hold down the control key then click one control and whilst holding down the mouse AND the control key make a connection to the next control you want to be the next tab.

The same procedure is used to link outlets in the controller to controls and controls to their targets in the controller.

Well that's what I think you're asking....

paddy learner
Oct 26, 2005, 07:29 AM
thanks
back in an hour if that dosnt pan out

paddy learner
Oct 26, 2005, 09:49 AM
for me there exists several possibilites

the most likley is some combination of button pressing exists that will do this funcion

or the keyboard on ibook isnt the same as the normal mac and so these features dont work

until there is a remap of the ibooks keyboards

or some patch download to solve that issue

or the program didnt install correctly and needs reinstalling

or xcode is another vapor ware that still in development:D

is there any download movies of this xcode working that does currency convertor or similar such as the four funcion calculator example from o Riely online cocoa book

or is there a way to hard code in the tab select section and the

Set the First Responder for the Currency Converter Window which is also dependent on this control drag system that dosnt work

yeah I know dumb to hard code a GUI system but if GUI dosnt work on my computer at least later I might get the local cyber cafe to put the xworks into there single mac and do the work on thier computer

Paddy Learner

robbieduncan
Oct 26, 2005, 09:55 AM
XCode works perfectly well (although it sound like your issue is with Interface Builder). I have used both on iBooks in the past: they work fine. I assume you have a UK keyboard? Again I've used this in the past on an iBook (and currently without issue on my PowerBook).

I'm not on a Mac at the moment so I can't really post much more than that, sorry.

caveman_uk
Oct 26, 2005, 10:28 AM
for me there exists several possibilites

the most likley is some combination of button pressing exists that will do this funcion

or the keyboard on ibook isnt the same as the normal mac and so these features dont work

until there is a remap of the ibooks keyboards

or some patch download to solve that issue

or the program didnt install correctly and needs reinstalling

or xcode is another vapor ware that still in development:D

is there any download movies of this xcode working that does currency convertor or similar such as the four funcion calculator example from o Riely online cocoa book

or is there a way to hard code in the tab select section and the

Set the First Responder for the Currency Converter Window which is also dependent on this control drag system that dosnt work

yeah I know dumb to hard code a GUI system but if GUI dosnt work on my computer at least later I might get the local cyber cafe to put the xworks into there single mac and do the work on thier computer

Paddy Learner

Either your copy of the dev tools is borked or it's you.

It works on every copy of Interface Builder that I've ever used and I've used it on a ibook, powerbook and on a powermac. All with UK keyboards and keymaps - not that the control key moves anyway.

OK lets run through this again. You have interface builder open with your GUI in it. You select the first responder icon (click once on it - this will make sure that window is 'key') then hold down the control key. Whilst holding down the control key click and hold down the mouse/trackpad button. Drag the arrow across to the GUI you have drawn until it outlines the control you want to be the first responder. Let go of the button. You can then use the inspector to select the outlet/target you need to connect.

paddy learner
Oct 26, 2005, 10:44 AM
I bought the ibook in a shop in ireland switched on loaded up xcode and IB
and dived in:D

I will check but suspect it will be UK keyboard roman but with irish flag so under irish roman

what it shows from further investigation is that my intererpatation control which seemed to me to be the bootom left button marked ctrl might not be control as this screen capture suggest that symbol ^ above number 6 is control so will pursue this line of direction

paddy

robbieduncan
Oct 26, 2005, 10:49 AM
what it shows from further investigation is that my intererpatation control which seemed to me to be the bootom left button marked ctrl might not be control as this screen capture suggest that symbol ^ above number 6 is control so will pursue this line of direction

That's more than a little unlikely! Control is not on shift-6. It's near the bottom left of the keyboard. Are you sure you are following the instructions carefully. You don't press control then let it go. You need to hold it down.

paddy learner
Oct 26, 2005, 11:04 AM
i tried out ^ and that wasnt it

yes I hold down control ctrl all the time so thats unlikly to be reason

will respond later got top catch train to go to home

HiRez
Oct 26, 2005, 11:50 AM
what it shows from further investigation is that my intererpatation control which seemed to me to be the bootom left button marked ctrl might not be control as this screen capture suggest that symbol ^ above number 6 is control so will pursue this line of directionStop your pursuit. ^ is just the symbol sometimes used to represent the Control key. It does not mean the "carrat" key (Shift-6). I admit that can be confusing, as Option, Shift, and Command all get their own, less ambiguous symbols. They definitely mean the key marked "Control". Whether you actually have one of those or not is a different story...

gekko513
Oct 26, 2005, 12:03 PM
So what happens if you do the following.

1. Click once on the textfield next to "convert currence$". Just to select it. Let the mouse pointer hover over it.
2. Press and hold ctrl (don't let go)
3. Press the mouse button / mousepad button (don't let go)
4. Start dragging the mouse or use a third finger on the mouse pad.

Do you get a green rectangle around the textfield and a green line and arrow that follow your mouse pointer? If you don't, then something is wrong. If you do, you're on the right track. Drag it to the other textfield and let go of the mouse button.

Fukui
Oct 26, 2005, 12:32 PM
If I'm not mistaken, you can also right click and drag and have the same effect as ctrl-drag... at least in Webobjects...

If your desperate, try a two-button mouse and right-click-drag.
Ctrl is on the bottom right BTW. Why don't you try changing the keyboard layout to English US (which is what I'm sure apple uses in America) and try ctrl-drag...

Fukui
Oct 26, 2005, 12:48 PM
Video Here
http://www.rtlabs.com/fwork/

Watch the demonstration movie

paddy learner
Oct 26, 2005, 03:36 PM
So what happens if you do the following.

1. Click once on the textfield next to "convert currence$". Just to select it. Let the mouse pointer hover over it.
2. Press and hold ctrl (don't let go)
3. Press the mouse button / mousepad button (don't let go)
4. Start dragging the mouse or use a third finger on the mouse pad.

Do you get a green rectangle around the textfield and a green line and arrow that follow your mouse pointer? If you don't, then something is wrong. If you do, you're on the right track. Drag it to the other textfield and let go of the mouse button.



I have before done similar and I dont get this arrow stuff and the diagram inferred I should get an affect and nothing happened so suspect faulty installation bug or something
I will confim to-morrow what is the outcome but this looks very likely the solution

thanks
paddy learner

paddy learner
Oct 27, 2005, 07:37 AM
quote gekko513

Do you get a green rectangle around the textfield and a green line and arrow that follow your mouse pointer? If you don't, then something is wrong.

somethings definitly wrong followed instructions and dont get anything at all

Reinstalled software(just put in both disks and did the routine)
still the same dosnt work

As I am at cyber cafe with Broadband for the day is it possible to hook into xcodes teck dept remotely and get them to fix it

or is there a patch
or would changing from tiger to a lesser version like 9 or 10.xx solve the problem

All ears

Paddy

robbieduncan
Oct 27, 2005, 07:51 AM
Have you tried the XCode Mailing Lists (http://lists.apple.com/mailman/listinfo/xcode-users).

I am 99% sure that there is nothing wrong with the software and that you are doing something wrong.

There is no such thing as "xcodes teck dept". Apple do provide technical assistance for developers but it's not free. You need to pay per incident.

Please can you ensure that you are following the instructions to the letter. In the screenshots you posted you appear to have the wrong object selected.

paddy learner
Oct 27, 2005, 08:48 AM
when it mac products the chance of bugs is remote

I will try again for the millionth time

I will post screen shots from start to finish if I fail as that might supply the awnser

paddy

caveman_uk
Oct 27, 2005, 09:00 AM
when it mac products the chance of bugs is remote

I wouldn't say that. IB does have bugs but this ain't one of them.

paddy learner
Oct 27, 2005, 10:04 AM
First open xcode and make new file
currencyconvertor20
for this new attempt

then open IB and name currencyconvertor20 and save to chosen location

is it possible that chosen location is causing problems 5th photo shot

paddy learner
Oct 27, 2005, 10:17 AM
close xcode open IB

caveman_uk
Oct 27, 2005, 10:18 AM
Everything's OK so far. That location is fine.

gekko513
Oct 27, 2005, 11:08 AM
Dragging should look like this, just so you know. I remembered the details slightly wrong. Also, you will probably get a blue line instead of green. I've changed the selection colour. Also, I found out that you don't really have to click the textfield first, just start dragging.

I've been thinking about possible user errors. If you're dragging from the Connections window, that's the wrong approach. You should drag from the textfield itself. Just in case.

paddy learner
Oct 27, 2005, 03:19 PM
gekko and cave man will answer after pics

PICS continued

first pic drag down text field

second pic drag down text and change text

third pic highlight text field and then highlight attributes to change to connections

4th pic change choice to connections and delegaste is highlighted by default
5th pic change choice to nextkeyview

paddy learner
Oct 27, 2005, 03:33 PM
1st pic here
the nextkeyview stays highlighted

I place my finger on control button marked ctrl 2nd button from left at bottom of keyboard keeping it continuly pressed and bring the arrow over the hihlighted text field

the arrow dsnt show in the pic but is hovering over the top textfield

then I press the mouse pad and several thing happen which sholdnt

first the highlighted nextkeyview changes immedialy to the delegate highlight

the text field maintains the dotted button configeration for resize and when `I drag either nothing drags or a drag handle drags and resizes the top text field

as in pic 2

gekko513
Oct 27, 2005, 03:37 PM
Nevermind the connections window and whether or not nextkeyview is highlighted. That comes after you do the drag.

Edit: You seem to do it in the right way ... you should of course not resize the top text field, though, so the mouse pointer must be placed in the center of the text field. It doesn't matter that the highlighted nextkeyview changes.

paddy learner
Oct 27, 2005, 03:39 PM
paddy

paddy learner
Oct 27, 2005, 04:02 PM
thanks cave man and robbieduncan
gekko513
thanks you sure try hard but any attempt to do any thing over the text fields only lights up the six resize blue button holders

I figure that there is some tiny glitch that is causing the problem

is it better to pursue down grading from tiger to panter as A guy I know has last years iBook with some lesser version or should I install the classic or 9 version from my own disks

for the moment the piority is to get some form of xcode working or some other type such as crystal or similar freebee developer program

paddy

paddy learner
Oct 27, 2005, 04:10 PM
will check back one hour but not with broad band only slow tele connection
\
tomorrow back on broad band in the morning

paddy

gekko513
Oct 27, 2005, 04:23 PM
This is indeed very strange ... you can set the nextkeyview programmatically, but you need to get this interfacebuilder thing to work if you're going to use Xcode in an efficient manner.

robbieduncan
Oct 27, 2005, 04:23 PM
Starting with the first picture I have nothing connected. The second picture shows what it looks like after I have control clicked in the first text field and dragged it to the second.

When you release the the mouse button the inspector will show the Target/Action tab. Change it to the Outlets tab and select nextKeyView which will be bold. It's now connected.

At the end it looks like the 3rd screenshot.

Done

paddy learner
Oct 28, 2005, 07:10 AM
today located another user of last years apple iBook and fired up his xcode and the program funcioned correctly on his cibook drag control etc
same finger operation dosnt work on my I book so as the other guy is more advanced in Aple book he is doing various reinstalles software updates to see if that solves the problem

will return when results are known

Paddy

gekko513
Oct 28, 2005, 07:14 AM
I'm glad you got some help eventually. I'm also glad that we were able to determine that it is some kind of issue with your installation and not some kind of issue with the collective communication skills of us forum posters. :p

paddy learner
Oct 28, 2005, 07:35 AM
pic says it all

the chose in the interface builder preferences was ticked so blocking all acces to drag drop faciltly:o :o

in the pic the tick is removed and program funcions correcly:o :o

ah well learnt a lot about grab and forums etc
of to buy a pint for the other guy for cracking it :eek: