Andri Yadi

A geeky technopreneur, trying to do something big with his startup

Catatan Belajar Sore Ini

March 31, 2009

Button_FunViewController.h

#import <UIKit/UIKit.h>

@interface Button_FunViewController : UIViewController {
    IBOutlet UILabel *statusText;
}

@property (retain, nonatomic) UILabel *statusText;

- (IBAction)buttonPressed:(id)sender;

@end



Button_FunViewController.m

#import "Button_FunViewController.h"

@implementation Button_FunViewController
@synthesize statusText;

-(IBAction)buttonPressed:(id)sender
{
    NSString *title = [sender titleForState:UIControlStateNormal];
    NSString *newText = [[NSString alloc] initWithFormat:
                         @"%@ button pressed.", title];
    statusText.text = newText;
    [newText release];
}

-(BOOL)shouldAutorotateInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];    
}

- (void)dealloc {
    [statusText release];
    [super dealloc];
}

@end



Ada yang tahu itu bahasa apa dan code di atas ngapain? Kalau ada, berarti sudah ada yang lebih dulu menguasai. And to whoever he/she is: "Master, I beg you to teach me!!. You Kung fu is very good."

More post (about this) to come.


Share this post: | | | |
Published Mar 31 2009, 04:46 PM by andriyadi
Filed under:

Comments

 

irwansyah said:

Cuma ganti text di button doang ya?

March 31, 2009 6:21 PM
 

ishakahmad said:

Hehehe... iPhone programming. :D

March 31, 2009 6:38 PM
 

irwansyah said:

eh salah liat, ganti text di label

March 31, 2009 8:51 PM
 

andriyadi said:

@irwansyah

Betul.

Kalau maksudnya pasti pada ngerti. Cuman syntax-nya itu lho..weird..

@ishakahmad

Masih belajar bro :)

March 31, 2009 11:11 PM
 

irwansyah said:

Begitulah objective-c tapi menurut gw kesan awalnya aja. Karena itu bahasa kan sudah dirancang untuk simplify segala macem.

April 1, 2009 12:13 AM