Bluetooth On/Off 와 비슷하나 dylib 에서 가능하다고 함.


1. On app


notify_post("com.yourcompany.yourapp.yournotification");


2. On dylib


#import <SpringBoard/SBWiFiManager.h>


HOOK(SpringBoard, applicationDidFinishLaunching$, void, id app)
{

    // Listen for events via DARWIN NOTIFICATION CENTER

    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, &NotificationReceivedCallback, CFSTR("com.yourcompany.yourapp.yournotification"), NULL, CFNotificationSuspensionBehaviorCoalesce);
}


// THIS IS WHERE THE MAGIC HAPPENS
static void NotificationReceivedCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)

{

    [[objc_getClass("SBWiFiManager") sharedInstance] setWiFiEnabled:NO];
}


관련링크: http://stackoverflow.com/questions/2053114/iphone-wi-fi-manager-sdk


'Mobile > iOS' 카테고리의 다른 글

Bluetooth On/Off  (0) 2012.07.25
Launch image 효과  (0) 2012.07.24
상태바 스타일 변경  (0) 2012.07.24
HTTP 파일 이어받기  (0) 2012.07.11
Rounded corners on a view  (0) 2012.07.02

아래의 방법은 AppStore 의 리뷰를 통과하지 못할 것이라고 알고있음.


1. GameKit Framework 추가


2. 다음 코드를 수행하여 BTServer 와 연결

Class BluetoothManager = objc_getClass("BluetoothManager");

[BluetoothManager sharedInstance];


3. 다음 코드로 상태 변경 (setEnabled 또는 setPowered 메소드 사용)

id btCont = [BluetoothManager sharedInstance];

[btCont setEnabled:![btCont enabled]];

'Mobile > iOS' 카테고리의 다른 글

WiFi On/Off  (0) 2012.07.25
Launch image 효과  (0) 2012.07.24
상태바 스타일 변경  (0) 2012.07.24
HTTP 파일 이어받기  (0) 2012.07.11
Rounded corners on a view  (0) 2012.07.02

application:didFinishLaunchingWithOptions: 에서 여러가지 효과를 줄 수 있다.


NSThread.sleepForTimeInterval: 을 사용하여 보여지는 최소 시간을 보장할 수 있다.



Launch image 를 보여주는 view 를 만들어 앱이 보여질 때 FadeIn 효과를 줄 수 있다.


UIImage *image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default" ofType:@"png"]];

UIView *imageView = [[UIImageView alloc] initWithImage:image];

[image release];

imageView.frame = self.window.bounds;

[self.window addSubview:imageView];


[UIView animateWithDuration:1.0f delay:0.0f options:UIViewAnimationOptionLayoutSubviews animations:^{

    imageView.alpha = 0.0f;

} completion:^(BOOL finished) {

    [imageView removeFromSuperview];

    [imageView release];
}];


'Mobile > iOS' 카테고리의 다른 글

WiFi On/Off  (0) 2012.07.25
Bluetooth On/Off  (0) 2012.07.25
상태바 스타일 변경  (0) 2012.07.24
HTTP 파일 이어받기  (0) 2012.07.11
Rounded corners on a view  (0) 2012.07.02

plist 에 "Status bar style" 을 추가하여 원하는 값을 선택한다.


[UIApplication sharedApplication].statusBarStyle 속성을 사용할 수도 있지만 이 경우 Launch image 에서는 기본 Status bar 로 보여 이상해진다.


'Mobile > iOS' 카테고리의 다른 글

Bluetooth On/Off  (0) 2012.07.25
Launch image 효과  (0) 2012.07.24
HTTP 파일 이어받기  (0) 2012.07.11
Rounded corners on a view  (0) 2012.07.02
in-house 배포시 배포 URL  (0) 2012.05.24

아래 코드는 사용해 보지 않은 메모용 코드임.


NSMutableURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];


NSString *range = [[NSString alloc] initWithFormat:@"bytes=%d-", offset];

[request setValue:range forHTTPHeaderField:@"Range"];

[range release];


'Mobile > iOS' 카테고리의 다른 글

Launch image 효과  (0) 2012.07.24
상태바 스타일 변경  (0) 2012.07.24
Rounded corners on a view  (0) 2012.07.02
in-house 배포시 배포 URL  (0) 2012.05.24
[Simulator] 단축키  (0) 2012.05.02

draw 발생시마다 설정하지 않고 한번만 해주면 된다.

layer 와 관련된 코드이니 layer 를 재구현하여 주자.


- (CALayer *)layer

{

    CALayer *layer = [super layer];

    layer.cornerRadius = 10.0f;

    layer.masksToBounds = YES;

    return layer;

}


참고: http://j07051.tistory.com/489

'Mobile > iOS' 카테고리의 다른 글

상태바 스타일 변경  (0) 2012.07.24
HTTP 파일 이어받기  (0) 2012.07.11
in-house 배포시 배포 URL  (0) 2012.05.24
[Simulator] 단축키  (0) 2012.05.02
[AudioFileServices] Result Codes  (0) 2012.04.05
ipa, plist 를 같은 경로에 위치시킨다.

itms-services://?action=download-manifest&url=[plist 파일 주소]


'Mobile > iOS' 카테고리의 다른 글

HTTP 파일 이어받기  (0) 2012.07.11
Rounded corners on a view  (0) 2012.07.02
[Simulator] 단축키  (0) 2012.05.02
[AudioFileServices] Result Codes  (0) 2012.04.05
UIImage 자르기  (0) 2012.03.20

CMD + SHIFT, SHIFT or SHIFT x 3: Toggle Slow Animations.


'Mobile > iOS' 카테고리의 다른 글

Rounded corners on a view  (0) 2012.07.02
in-house 배포시 배포 URL  (0) 2012.05.24
[AudioFileServices] Result Codes  (0) 2012.04.05
UIImage 자르기  (0) 2012.03.20
[iOS] NSTimer 사용  (0) 2012.03.13


Result Code

Value

Description

kAudioFileUnspecifiedError

'wht?'

지정되지않은 오류 발생. iOS 2.0 이후.

kAudioFileUnsupportedFileTypeError

'typ?'

지원되지않는 파일 형식 입니다. iOS 2.0 이후.

kAudioFileUnsupportedDataFormatError

'fmt?'

이 파일 형식에서는 지원되지 않는 데이터 형식입니다. iOS 2.0 이후.

kAudioFileUnsupportedPropertyError

'pty?'

지원되지 않는 속성입니다. iOS 2.0 이후.

kAudioFileBadPropertySizeError

'!siz'

속성 데이터의 크기가 올바르지 않습니다. iOS 2.0 이후.

kAudioFilePermissionsError

'prm?'

파일사용권한 위반 작업. 예를 들어, kAudioFileReadPermission 상수를 이용하여 연 파일에 대한 쓰기 시도. iOS 2.0 이후.

kAudioFileNotOptimizedError

'optm'

오디오 데이터 청크 뒤에 오는 청크가 오디어 데이터 청크의 확장을 방해하고 있습니다. 더 많은 데이터를 쓰기 위해, 파일을 최적화해야 합니다. iOS 2.0 이후.

kAudioFileInvalidChunkError

'chk?'

청크가 파일에 존재하지 않거나, 파일에 의해 지원되지 않습니다. iOS 2.0 이후.

kAudioFileDoesNotAllow64BitDataSizeError

'off?'

파일 오프셋이 파일 형식에 비해 너무 큽니다. AIFF 와 WAVE 파일 형식은 32비트 파일 크기 제한이 있습니다. iOS 2.0 이후.

kAudioFileInvalidPacketOffsetError

'pck?'

A packet offset was past the end of the file, or not at the end of the file when a VBR format was written, or a corrupt packet size was read when the packet table was built. iOS 2.0 이후.

kAudioFileInvalidFileError

'dta?'

파일 형식이 잘못되었거나, 그 형식의 오디오 파일의 유효한 인스턴스가 아닙니다. iOS 2.0 이후.

kAudioFileOperationNotSupportedError

0x6F703F3F

작업을 수행할 수 없습니다. 예를 들어, 파일에서 오디오 데이터의 크기를 증가시키기 위해 kAudioFilePropertyAudioDataByteCount 상수를 설정하는 것은 지원되는 작업이 아닙니다. 대신 데이터를 씁니다. iOS 2.0 이후.

kAudioFileNotOpenError

-38

닫힌 파일. iOS 4.2 이후.

kAudioFileEndOfFileError

-39

파일의 마지막. iOS 4.0 이후.

kAudioFilePositionError

-40

잘못된 파일 위치. iOS 4.0 이후.

kAudioFileFileNotFoundError

-43

파일 없음. iOS 4.0 이후.


'Mobile > iOS' 카테고리의 다른 글

in-house 배포시 배포 URL  (0) 2012.05.24
[Simulator] 단축키  (0) 2012.05.02
UIImage 자르기  (0) 2012.03.20
[iOS] NSTimer 사용  (0) 2012.03.13
[iOS] NSMutableDictionary 상속, "method only defined for abstract class"  (0) 2012.03.02

UIImage 의 일부 영역을 CGImage 로 변환 후 UIImage 로 변환


CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], CGRectMake(0, 0, iWidth, iHeight));
UIImage *image = [[UIImage imageWithCGImage:imageRef] autorelease];
CGImageRelease(imageRef); 
 

+ Recent posts