NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data];
Creating an UIImage from a URL
iPhone SDK Tips & Tricks
Labels:
iphone SDK
iPhone Vibrate
iPhone SDK Tips & Tricks
Don't forget to import AudioServices.h:
#import <AudioToolbox/AudioServices.h>
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
Don't forget to import AudioServices.h:
#import <AudioToolbox/AudioServices.h>
Labels:
iphone SDK
Text Button Alignment
iPhone SDK Tips & Tricks
typedef enum {
UIControlContentVerticalAlignmentCenter = 0,
UIControlContentVerticalAlignmentTop = 1,
UIControlContentVerticalAlignmentBottom = 2,
UIControlContentVerticalAlignmentFill = 3,
} UIControlContentVerticalAlignment;
typedef enum {
UIControlContentHorizontalAlignmentCenter = 0,
UIControlContentHorizontalAlignmentLeft = 1,
UIControlContentHorizontalAlignmentRight = 2,
UIControlContentHorizontalAlignmentFill = 3,
} UIControlContentHorizontalAlignment;
UIButton *accountButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
accountButton.frame = CGRectMake(10, 40, 100, 45); // size and position of button
[accountButton setTitle:@"label" forState:UIControlStateNormal];
accountButton.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom;
typedef enum {
UIControlContentVerticalAlignmentCenter = 0,
UIControlContentVerticalAlignmentTop = 1,
UIControlContentVerticalAlignmentBottom = 2,
UIControlContentVerticalAlignmentFill = 3,
} UIControlContentVerticalAlignment;
typedef enum {
UIControlContentHorizontalAlignmentCenter = 0,
UIControlContentHorizontalAlignmentLeft = 1,
UIControlContentHorizontalAlignmentRight = 2,
UIControlContentHorizontalAlignmentFill = 3,
} UIControlContentHorizontalAlignment;
Labels:
iphone SDK
Subscribe to:
Posts (Atom)