Created
July 15, 2012 02:45
-
-
Save chyld/3114567 to your computer and use it in GitHub Desktop.
notes - ios for beginners
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
Register as an apple developer: | |
------------------------------------------------------------------------------------------------- | |
https://developer.apple.com/devcenter/ios/index.action | |
Evaluate the different types of developer program: | |
------------------------------------------------------------------------------------------------- | |
https://developer.apple.com/programs/which-program/ | |
Changing the text of a label: | |
------------------------------------------------------------------------------------------------- | |
label.text = @"hello world"; | |
Changing the label color: | |
------------------------------------------------------------------------------------------------- | |
label.textColor = [UIColor cyanColor]; | |
Change the label text from a textbox: | |
------------------------------------------------------------------------------------------------- | |
label.text = [textbox text]; | |
Change the transparency of a textbox using a slider: | |
------------------------------------------------------------------------------------------------- | |
textbox.alpha = [slider value]; | |
Change an image: | |
------------------------------------------------------------------------------------------------- | |
switch ([segment selectedSegmentIndex]) { | |
case 0: | |
[imageview setImage:[UIImage imageNamed:@"one.jpg"]]; | |
break; | |
case 1: | |
[imageview setImage:[UIImage imageNamed:@"two.jpg"]]; | |
break; | |
case 2: | |
[imageview setImage:[UIImage imageNamed:@"three.jpg"]]; | |
break; | |
} | |
Getting the web control to work: | |
------------------------------------------------------------------------------------------------- | |
@interface TMViewController : UIViewController | |
<UITextFieldDelegate> | |
@property (weak, nonatomic) IBOutlet UITextField *textbox; | |
@property (weak, nonatomic) IBOutlet UIWebView *web; | |
@end | |
- (BOOL)textFieldShouldReturn:(UITextField *)textField | |
{ | |
[web loadRequest: | |
[NSURLRequest requestWithURL: | |
[NSURL URLWithString:[textbox text]]]]; | |
[textField resignFirstResponder]; | |
return YES; | |
} | |
Getting the map control to work: | |
------------------------------------------------------------------------------------------------- | |
#import <UIKit/UIKit.h> | |
#import <MapKit/MapKit.h> | |
@interface TMViewController : UIViewController | |
@property (weak, nonatomic) IBOutlet MKMapView *map; | |
- (IBAction)satellite:(id)sender; | |
@end | |
- (IBAction)satellite:(id)sender { | |
[map setMapType:MKMapTypeSatellite]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment