Created
March 14, 2013 14:05
-
-
Save amay077/5161582 to your computer and use it in GitHub Desktop.
Xamarin.iOS の Tutorial をなんとなくトレースしてみる ref: http://qiita.com/items/bac6621007ecfe7dddb9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@property (retain, nonatomic) IBOutlet UIButton *btnClickMe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)actnButtonClick:(id)sender; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace HelloWorld_iPhone | |
{ | |
public partial class HelloWorld_iPhoneViewController : UIViewController | |
{ | |
protected int _numberOfTimesClicked = 0; | |
<省略> | |
public override void ViewDidLoad() | |
{ | |
base.ViewDidLoad(); | |
// Perform any additional setup after loading the view, typically from a nib. | |
btnClickMe.TouchUpInside += (sender, e) => | |
{ | |
_numberOfTimesClicked++; | |
lblOutput.Text = "Clicked [" + | |
_numberOfTimesClicked.ToString() + "] times!"; | |
}; | |
} | |
<省略> | |
partial void actnButtonClick(NSObject sender) | |
{ | |
lblOutput.Text = "Action button " + ((UIButton)sender).CurrentTitle + " clicked."; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MonoTouch.Foundation; | |
namespace HelloWorld_iPhone | |
{ | |
[Register ("HelloWorld_iPhoneViewController")] | |
partial class HelloWorld_iPhoneViewController | |
{ | |
[Outlet] | |
MonoTouch.UIKit.UIButton btnClickMe { get; set; } | |
void ReleaseDesignerOutlets () | |
{ | |
if (btnClickMe != null) { | |
btnClickMe.Dispose (); | |
btnClickMe = null; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment