This file contains hidden or 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
pixelmator | |
http://help.pixelmator.com/#118 |
This file contains hidden or 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
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; | |
NSArray *fontNames; | |
NSInteger indFamily, indFont; | |
for(indFamily=0;indFamily<[familyNames count];++indFamily) | |
{ | |
NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]); | |
fontNames =[[NSArray alloc]initWithArray:[UIFont fontNamesForFamilyName:[familyNames objectAtIndex:indFamily]]]; | |
for(indFont=0; indFont<[fontNames count]; ++indFont) | |
{ | |
NSLog(@" Font name: %@",[fontNames objectAtIndex:indFont]); |
This file contains hidden or 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
因为播放器只支持播放NSURL参数的资源,所以要播放本地文件时,需要将路径参数转化为 | |
本地路径构造URL,使用NSURL 提供的静态方法fileURLWithPath | |
Creating an NSURL | |
– initWithScheme:host:path: | |
+ URLWithString: | |
– initWithString: | |
+ URLWithString:relativeToURL: | |
– initWithString:relativeToURL: | |
+ fileURLWithPath:isDirectory: |
This file contains hidden or 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
1. 安装Ubuntu Server版本 | |
2. 更新软件源 | |
sudo apt-get update | |
3. 安装open-ssh | |
sudo apt-get install openssh-server | |
4. 提升ssh认証时间 |
This file contains hidden or 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
BOOL isCameraValid = YES; | |
//判断iOS7的宏,没有就自己写个,下边的方法是iOS7新加的,7以下调用会报错 | |
if(isIOS7AndLater) | |
{ | |
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; | |
if (authStatus != AVAuthorizationStatusAuthorized) | |
{ | |
isCameraValid = NO; | |
} | |
} |
This file contains hidden or 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
[self.motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMDeviceMotion *motion,NSError *error){ | |
double gravityX = motion.gravity.x; | |
double gravityY = motion.gravity.y; | |
double gravityZ = motion.gravity.z; | |
NSLog(@"gravityX = %f",gravityX); | |
NSLog(@"gravityY = %f",gravityY); |
This file contains hidden or 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
#import <CommonCrypto/CommonDigest.h> | |
- (NSString *)md5HexDigest:(NSString*)password | |
{ | |
const char *original_str = [password UTF8String]; | |
unsigned char result[CC_MD5_DIGEST_LENGTH]; | |
CC_MD5(original_str, strlen(original_str), result); | |
NSMutableString *hash = [NSMutableString string]; | |
for (int i = 0; i < 16; i++) | |
{ |
This file contains hidden or 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
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); | |
NSString *documentsDirectory = [paths objectAtIndex:0]; |