HOME - WEBDESIGN / IPHONE APP - ALL IN VAIN - PICTURES - FORUM - DEVELOPEMENT - MYSPACE - TWITTER - YOUTUBE - CATEGORIES - Login/Registration - RSS

Countdown bis zum Greenfield 2011:


how to dismiss keyboard in uitextview


in Allgemeines,Anleitung,Development,How-To,iPhone,Tutorial @ 16:02 am 15. März 2011
Comments: 0

In my iPhone application I had a UITextView and I wanted to allow the user to insert text and submit it. The problem was that the keyboard didn’t disappear when you clicked on return or done. I searched quite a bit and found this working solution:

In your controller .h file:

@interface YourController : UIViewController  {
IBOutlet UITextView *textView;
}

In your controller.m file:

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
NSLog(@"called");
if([text isEqualToString:@"\n"]) {
[textView resignFirstResponder];
return NO;
}
return YES;
}

This function gets called every time you insert a character. If you click on Return/Finish/Whatever, the keyboard will be dismissed.
If it doesnt work, open Interface Builder and map your UITextView with the Files owner and assign delegate. Put your comments into the comment section.


An Twitter senden, Geposted von Pädde


apple wireless keyboard unboxing and installing


One week ago I bought the Apple Cinema Display 27 Inch and I used my old cabled keyboard from Apple. This keyboard was like 2 years old and the “T” key didn’t work properly :) So I decided to go to the next Apple Store to buy the wireless keyboard.


(weiterlesen…)

An Twitter senden, Geposted von Pädde


sqlite3 umlauts/special character problem


When you are developing an iPhone application, you will most likely have to use an internal database to store your data. I also needed a database for my Facts iPhone application. As the app contains german words, it also contains umlauts and special characters like äöü and all this stuff that is not present in the english language. However, I was not able to support these special characters although I used UTF8 encryption in my application.

To create the database, I used the following commands in terminal:

cd Desktop
mkdir FactsDatabase
cd FactsDatabase
sqlite3 facts.sqlite

Now you will see the sqlite command prompt which only accepts sql commands from now on. This is where I have created my database, and inserted some facts:

// create table
create table facts(id integer primary key, fact text, isFavorite varchar(5), alreadyRead varchar(5));

// fill database with facts
sqlite3 facts.sqlite “INSERT INTO facts(fact, isFavorite, alreadyRead) values(‘Täglich werden 12 Neugeborene den falschen Eltern gegeben.’, ‘no’,'no’);”

Now if you do it like this, the special characters won’t show up in your application. After some hours of trying I tried to use run my sqlite commands in a shell script. I had to rearrange the commands to fit like this:

# drop exising table
sqlite3 facts.sqlite “drop table facts;”

# create database
sqlite3 facts.sqlite “create table facts(id integer primary key, fact text, isFavorite varchar(5), alreadyRead varchar(5));”

# fill database with facts
sqlite3 facts.sqlite “INSERT INTO facts(fact, isFavorite, alreadyRead) values(‘Täglich werden 12 Neugeborene den falschen Eltern gegeben.’, ‘no’,'no’);”

Save it as database.sh and in terminal, give it the rights to execute: chmod+x database.sh, and then run it with ./database.sh
If you do it like this, the special characters are finally in the database and will show up in your application. To be honest, I have no idea why it only works with this workaround. It costed me quite a bit of time. Anyway, hope that helps anyone. If you have questions, use the comment section. Cheers.


An Twitter senden, Geposted von Pädde


endlich, mein neues autoradio!


in Allgemeines,Anleitung,Basteln,Musik @ 20:06 am 6. Oktober 2008
Comments: 4

Was nützt dir ein Autoradio, welches nur CDs wiedergeben kann? Oder ein Autoradio welches nicht mal Radiosender anzeigt, und schon gar nicht über RDS verfügt. In einer Zeit von iPods, iPhones und MP3 Playern wärs doch noch angenehm, wenn man sein iPhone einfach ans Autoradio hängen könnte.

Genau das habe ich mir auch gedacht, und entschieden: “Ein neues Autoradio muss her”. Heute hab ich nun endlich Bescheid bekommen, dass mein Autoradio abholbereit ist. Ich nahm also die 40 Minuten Autoweg (schon etwa zum 6 mal diese Woche) nach Emmenbrücke in Angriff. Ich hatte glück, den heute war dort alles 10% billiger. Somit hab ich den Adapter sozusagen noch umsonst gekommen.

Zuhause angekommen, hab ich sofort alles ausgepackt und begonnen, das Teil aus und dan einzubauen.

So sah das alte Autoradio aus. Wie ihr seht, 0815 snif

(weiterlesen…)

An Twitter senden, Geposted von Pädde