But what is "does not work"? A bit clearer description would help. The 3 things to mention are:
What did you do - We've got your code and the hardware, so that bit is good enough.
What did you expect to happen - What did you want that particular program to do -
What actually did happen - like the "message only appeared once" (Reading the code we can only describe what you have coded - which means we do not know what you indeted it to do.)
I want that when I connect the iPad to the Arduino Bord that there is written in my TextView Hello World but it doesnt!
And i dont know what my mistake is, because in Xcode and arduino is all right i think!
The Serial.available() function on the Arduino returns the number of bytes available to be read. It can NEVER return a value less than 0. Testing for less than 0 shows cluelessness. You don't want to do that, do you?
OK, that last sentence makes more sense. I do not understand the other two module/Languages you have in your top post, but I do understand the Arduino.
Your Arduino code will continously output "Hello World" on the Serial line which is the USB which must have been configured at the iPad end. When any single character arrives on the input, it will output one "Bye "World" and blink the LED. Unfortunatly you have not described if "Does not work" implies that we have reached the blinking part or are still i the first part. Try an initial blink (in the setup routine) to verify startup.
I dont know how the iPad USB connection works. On other machines when the USB is "activated" it will cause the Arduino to reset. The boot loader starts first and listens if you are downloading a new program. Depending on various transients there may be a few "junk" characters (until the Serial protocol/USB emulation thereof stabilises) and the Bootloader gives up waiting for a new program. THEN you program will start, and only then will it set the Baudrate. All the previous stuff may confuse your program/iPad USB converter.
I have heard that it is almost impossible to communicate with the iPad because of Apple's proprietary stance on peripherals. Have you tried to go through the Apple developer channels on this? You may find that you need to put up a lot of $$$ to get this simple task completed.
I know that is it possible to connect the iPad with the Arduino.
@ MSquare: I did not connect the iPad to the Arduino with USB. The Output from my iPad goes to the Arduino TX and RX.
And the USB goes to my MacBook, because the Arduino Need power.
It is possible that the Arduino Board send the Message to m MacBook?
And the LED BLINK sometimes when I disconnect my iPad from the Board!
The TX/RX lines of the serial are connected to the USB-Serial converteor on the Arduino board. So if you send on the Arduino it will also appear on the Mac. Lots of room for confusion here. Get a 7, 9 or 12V wallwart adaptor (5 will also work, but is below spec) and use the power input on the Arduino. Possibly (I am not sure) it will help to just plug the USB in a USB charger to supply the Arduino.