• iSENDu

    • iSENDu Videos
  • S-Cube

    • S-Cube Project
  • Event Seeker

    • volume.at
  • q·.:World

    • q·.:LAUNCHER
    • q·.:CARD
    • q·.:Generator
    • q·.:Specs
  • Home

    • Imprint
    • GTC
    • Sitemap
  • services
  • blog
  • help
  • about

ikangai.com

  • Search Blog

  • Pages

    • A Cross-Platform Software System to Create and Deploy Mobile Mashups
    • Apps using q·.:Codes
    • Concours Worldvision de la q·.:Launcher
    • expressFLOW
    • Prototype
  • Latest Entries

    • Writing Scientific Papers
    • Code Snippet of the Week: Using Quartz to draw the background of UIButtons
    • Concours Worldvision de la q·.:Launcher
    • Concours Eurovision de la Chanson
    • We’ve got mail from Apple
  • Categories

    • Code snippet (1)
    • Design (11)
    • Development (32)
    • Events (7)
    • Hardware (2)
    • iSENDu (39)
    • iTunes App Store (20)
    • News (13)
    • Science (7)
    • Software (18)
    • Sports (1)
    • Uncategorized (48)
    • University (2)
    • Website (4)
  • Archives

    • August 2010 (2)
    • July 2010 (7)
    • June 2010 (7)
    • May 2010 (6)
    • April 2010 (13)
    • March 2010 (11)
    • February 2010 (8)
    • January 2010 (8)
    • December 2009 (9)
    • November 2009 (6)
    • October 2009 (8)
    • September 2009 (13)
    • August 2009 (14)
  • Subscribe

    • Subscribe rss feed

Archive for January, 2010

Code Snippet of the week – Modal UIAlertView...

Friday, January 29th, 2010

A modal UIAlertView can be implemented completely differently than we did in our code snippet of the week. Erica Sadun’s iPhone cookbook provides an elegant solution for this problem. In a nutshell, the idea is to utilize the runloop as shown in the code snippet below.

#import "ModalAlert.h"
@interface ModalAlertDelegate : NSObject uialertviewdelegate
{
CFRunLoopRef currentLoop;
NSUInteger index;
}
@property (readonly) NSUInteger index;
@end
@implementation ModalAlertDelegate
@synthesize index;
-(id) initWithRunLoop: (CFRunLoopRef)runLoop
{
if (self = [super init]) currentLoop = runLoop;
return self;
}
-(void) alertView: (UIAlertView*)aView clickedButtonAtIndex: (NSInteger)anIndex
{
index = anIndex;
CFRunLoopStop(currentLoop);
}
@end
@implementation ModalAlert
+(NSUInteger) queryWith: (NSString *)question button1: (NSString *)button1 button2: (NSString *)button2
{
CFRunLoopRef currentLoop = CFRunLoopGetCurrent();
ModalAlertDelegate *madelegate = [[ModalAlertDelegate alloc] initWithRunLoop:currentLoop];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:question message:nil delegate:madelegate cancelButtonTitle:button1 otherButtonTitles:button2, nil];
[alertView show];
CFRunLoopRun();
NSUInteger answer = madelegate.index;
[alertView release];
[madelegate release];
return answer;
}
+ (BOOL) ask: (NSString *) question
{
return ([ModalAlert queryWith:question button1: @"Yes" button2: @"No"] == 0);
}
+ (BOOL) confirm: (NSString *) statement
{
return [ModalAlert queryWith:statement button1: @"Cancel" button2: @"OK"];
}
@end

your coding ikangai team

Tags: Code snippet, Modal, UIAlertView
Posted in Development, News | No Comments »

English is a very interesting language

Wednesday, January 27th, 2010

The use of the English language can be quite challenging for people who are not native speakers. Especially, when writing for the first time longer texts that treat technical or scientific topics. Being a student supervisor at university, I’m often confronted with an unorthodox use of the English language. Word by word translations are quite common, but sometimes one happens to come across really special creations of students:

We circumfenced the problem. And then we shot it, right? But, wait a minute, what is circumfence?

That is no installation to be sneezed at. Hmm, I knew it’s going to be difficult.

The system consists of public and private parts. Wow! Now I see systems with completely different eyes.

The system must be expendable. Yep! This devilishly similar to other words like expandable or extendable.

If it’s not then… If this is not similar to A fish called Wanda “Well, when then… Well wonder Wanda.. Wendy?”

Your ikangai university team

Tags: blooper, student, The system consists of public and private parts
Posted in Uncategorized | No Comments »

Code snippet of the week-Modal UIAlertView

Monday, January 25th, 2010

Some things on the iPhone are more complicated than they need to be. One example is the use of modal UIAlertViews to ask the user for feedback before continuing with the execution of the program. In a pseudo code notation, it looks like this:

startWithSomething()
int res = Inputbox("Do you want to save the data?", Yes, No)
if (res==1) {
  doSomething()
} else {
  doSomethingElse()
}
continueWithSomething()

This pseudo code snippet would wait until the user either decides Yes and then execute doSomething() followed by continueWithSomething() or doSomethingElse() followed by continueWithSomething().
If one decides to implement the same on the iPhone, we need to do a few additional things. First of all, we need to create an UIAlertView delegate that implements the UIAlertViewDelegate protocol. Then, we need to assure that the delegate informs us about the user decision. We do this by generating events to which we attach event observers:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doSomething:) name:@"UserSaysYes" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doSomethingElse:) name:@"UserSaysNo" object:nil];

This code listens for events with the name UserSaysYes (UserSaysNo) and calls the method doSomething (doSomethingElse) if the corresponding event can be observed.
In the UIAlertViewDelegate we need to generate the events by adding the following code:

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex=0) {
NSMutableArray *keys = [NSMutableArray arrayWithObjects:@"Info", nil];
NSMutableArray *objects = [NSMutableArray arrayWithObjects:@"Yes Sir!" , nil];
NSDictionary *info = [[NSDictionary dictionaryWithObjects:objects forKeys:keys]];
[[NSNotificationCenter defaultCenter]postNotificationName:@"UserSaysYes" object:info];
} else {
NSMutableArray *keys = [NSMutableArray arrayWithObjects:@"Info", nil];
NSMutableArray *objects = [NSMutableArray arrayWithObjects:@"No Sir!" , nil];
NSDictionary *info = [[NSDictionary dictionaryWithObjects:objects forKeys:keys]];
[[NSNotificationCenter defaultCenter]postNotificationName:@"UserSaysNo" object:info];
}

The implementation of doSomething (doSomethingElse) is straightforward: we parse the notification object and print the content on the console. Then we call continueWithSomething in order to complete our example.

-(void) doSomething:(NSNotification *) notification {
NSDictionary *info = [notification object];
NSstring* text = [info objectForKey:@"Info"];
NSLog(text);
[self continueWithSomething];
}
-(void) doSomethingElse:(NSNotification *) notification {
NSDictionary *info = [notification object];
NSstring* text = [info objectForKey:@"Info"];
NSLog(text);
[self continueWithSomething];
}

The drawback of this method is obviously that the modal logic is scattered among different method implementations which can make a program hard to read. However, if you have one or two places in your code that need modal user input, this is certainly a way to do it.

Your ikangai team

Tags: Code Snippet of the Week, Modal, UIAlertView
Posted in Development, Software | No Comments »

iSENDu Youtube Comment

Thursday, January 21st, 2010

If you put a video on youtube, as we did with our promotion video, you can expect stupid, insulting and sometimes even disgusting comments. Usually, we delete this kind of comments the minute we read them and we forget about them. But this time, we wondered why should we? After reading this particular stupid and homophobic comment, we decided to write about it. The first thing thing that came into our minds was the question, why would one write this? If a person doesn’t like the video, that’s fine with us. If we get a comment saying things like:

Hi! I watched your video and there is something I would like to tell you. In my opinion the video is…

we gladly accept this and leave the comment for others to read. Hey! After all,we are all old enough to use a computer, and we can accept crictical comments. That’s the best thing you get on the Internet: you get feedback from thousands of people. It helps you to learn, and the next time, you can do better.
But, what can we learn from a comment like this:

i hate the intro it lukes gay its fucking long

Well, maybe we learned something about the person who wrote the comment and not about our video.

Your ikangai team

Tags: iSENDu, Youtube
Posted in iSENDu | No Comments »

Apple Tablet Speculations

Tuesday, January 19th, 2010

The Apple user community is well known (notorious ?) for speculations about not yet (never ?) released products. With the last announcement of Apple to hold a media event on January 27th, almost every Web Site that publishes Apple related news and rumors is reporting that a Apple Tablet is imminent.

Apple Media Event

Apple Media Event


From a developer’s perspective, new hardware is always exiting: new features need to be investigated, new APIs need to be learned and existing software needs to be adapted. The last couple of month saw no changes in the existing iPhone OS and based on past experiences one can speculate that a version 4.0 of the iPhone OS will be introduced soon.
This is further backed by the factor that the API description remained relatively untouched for several months now and we saw only minor changes there.
Even if we do not benefit from speculating about future Apple products, it’s fun to do so and we from ikangai would like to give our personal estimation for what is going to happen at the Apple Media Event:

iPhone OS 4.0 beta will be introduced

New iPod Touches will be introduced

We won’t see a new version of the iPhone (later this year though)

and

Yes! We think that a Tablet prototype will be shown (released date June)

We are aware that our speculations are based on other speculations which in turn are based on other speculations. But it appears to be exactly the same what analysts do ;-) and we always wanted to know how it feels like to be analyst :-) . Well, it’s really cool ;-) .

Your speculating and “analyzing” ikangai team

Tags: Analysis, Apple Tablet, Speculation
Posted in Events | No Comments »

Older Entries
Copyright © 2010 IKANGAI Solutions. Design by creativesyntax.at
IKANGAI Blog is powered by Wordpress | Login
Facebook It! Digg It! Stumble It! del.icio.us