iPhone이 슬립모드로 들어가지 않게 하는 방법이다..
[UIApplication sharedApplication].idleTimerDisabled = YES;
참~ 쉽죠~잉~
Posted by 마르스
[UIApplication sharedApplication].idleTimerDisabled = YES;
Posted by 마르스
-(void) myTestThread:(id)anObject {
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
//이곳에 처리할 코드를 넣는다.
[autoreleasepool release];
[NSThread exit];
}
그리고 쓰레드를 호출한다.
[NSThread detachNewThreadSelector:@selector(myTestThread:) toTarget:self withObject:nil];
간단~
Posted by 마르스
- (void)viewDidLoad {
[super viewDidLoad];
UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectZero];
label1.tag = 100;
[self.view addSubview:label1];
}
- (void) applyUser {
UILabel *label1 = (UILabel *) [self.view viewWithTag:100];
label1.text = "MARS";
}
Posted by 마르스
UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
Posted by 마르스
NSString *sourceString = @"username:password"; NSLog(@"Original string: %@", sourceString); NSData *sourceData = [sourceString dataUsingEncoding:NSUTF8StringEncoding]; NSString *base64EncodedString = [sourceData base64Encoding]; NSLog([NSString stringWithFormat:@"Encoded form: %@", base64EncodedString]); NSData *decodedData = [NSData dataWithBase64EncodedString:base64EncodedString]; NSString *decodedString = [[[NSString alloc] initWithData:decodedData encoding:NSUTF8StringEncoding] autorelease]; NSLog([NSString stringWithFormat:@"Decoded again: %@",decodedString]);
Posted by 마르스
NSURL *url = [NSURL URLWithString:@"https://www.google.com/accounts/ClientLogin"]; NSMutableURLRequest *loginRequest = [NSMutableURLRequest requestWithURL:url]; [loginRequest setHTTPMethod:@"POST"]; [loginRequest addValue:@"Content-Type" forHTTPHeaderField:@"application/x-www-form-urlencoded"]; [loginRequest addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; NSString *requestBody = [[NSString alloc] initWithFormat:@"Email=%@&Passwd=%@&service=finance&source=%@", @"mars", @"1234", [NSString stringWithFormat:@"%@%d", @"ashlux-igFinance-1.0"]]; [loginRequest setHTTPBody:[requestBody dataUsingEncoding:NSASCIIStringEncoding]]; NSHTTPURLResponse *response = NULL; NSData *responseData = [NSURLConnection sendSynchronousRequest:loginRequest returningResponse:&response error:nil]; NSString *responseDataString = [[NSString alloc] initWithData:responseData encoding:NSASCIIStringEncoding]; NSLog(@"Response from Google: %@", responseDataString);
Posted by 마르스
냉정함을 잃지말자...!!
- 마르스
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 |