Thursday, February 17, 2011

NSFileManager

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
NSString *secondaryDirectoryPath = [documentsDirectoryPath stringByAppendingPathComponent:@"secondary"];
NSString *databaseFile = [secondaryDirectoryPath stringByAppendingPathComponent:@"database.db"];

NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager removeItemAtPath:databaseFile error:NULL];

UIWebView disable scrolling

1. objc
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,320,480)];
[[[webView subviews] lastObject] setScrollEnabled:NO];

2. javascript
document.onload = function(){
    document.ontouchmove = function(e){ e.preventDefault(); }
};

Thursday, January 27, 2011

[Private]My Goal for Cross Development

1. Cross Platform(Titanium)*
2. Javascript
3. JQuery
4. C
5. Business Model

[Private]My Goal for iPhone

1. JSON Parser
2. XML Parser
3. CoreData & DB Access(local & remote)
4. Socket
5. Thread
6. File upload & download & caching(with progress bar)
7. Cookie
8. NSURLConnection

[Apple]ClipEnglish

My first registered iPhone App.


[하루하나 클립영어]



[Future]Cross platform

Important thing!


1. Titanium http://www.appcelerator.com/
2. Javascript / JQuery



Wednesday, January 26, 2011

[Basic]Hightlight effect button

When you touch the button, it will give the glow effect to the button.


[button setShowsTouchWhenHighlighted:YES];



Monday, January 24, 2011

[Source]Push & Pop with only button




If you want to hide the navigation bar in the all view, you can do push and pop with button.


[Download]

[Source]Push & Pop with Navigation Bar





Create a project with navigation controller. It hide the navigation bar at the first view and show the navigation bar and back button at the second view. Push will show the second view and pop will show the first view. The left navigation bar item operates the back button function.


[Download]

Wednesday, January 19, 2011

[Basic]UIButton & action

UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(150, 230, 19, 24)];
[button setBackgroundImage:[UIImage imageNamed:@"button.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:button];


- (void)buttonClick:(id)sender {
  // Do something ...
}

Thursday, January 13, 2011

[Basic]Scale for the iPhone Development

[Source]Tap Recognizer



This source is for the tap recognization in the iPhone.

When you tap the screen, the "Oh! iPhone mad" mark appear and soon disappear at the tap point.

Tuesday, January 11, 2011

[Basic]NSURL link (to Safari)

[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://www.google.com"]];

Monday, January 10, 2011

[Basic]AlertView

- (void)viewDidLoad {

    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title"
    message:@"Message\nMessage"
    delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", @"Cancel", nil];

    [alertView show];
    [alertView release];
}

- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 1) { // "Cancel" Button, close the alertView;
          // Do something
    } else { // buttonIndex == 0 // "OK" Button;
         // Do something
    }
 }