2011-07-06 125 views

回答

2
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    // Override point for customization after application launch. 

#if TARGET_IPHONE_SIMULATOR 
    exit(EXIT_SUCCESS) ; 
#else 
    /* this works in iOS 4.2.3 */ 
    Class BluetoothManager = objc_getClass("BluetoothManager") ; 
    id btCont = [BluetoothManager sharedInstance] ; 
    [self performSelector:@selector(toggle:) withObject:btCont afterDelay:1.0f] ; 
#endif 
    return YES ; 
} 

#if TARGET_IPHONE_SIMULATOR 
#else 
- (void)toggle:(id)btCont 
{ 
    BOOL currentState = [btCont enabled] ; 
    [btCont setEnabled:!currentState] ; 
    [btCont setPowered:!currentState] ; 

} 
#endif 

的代碼,我從here

1

嘗試使用此link 1 & link 2,它會下的iOS 3.x的工作...

+2

我在我的問題中明確提到我在4.3工作..任何方式謝謝你.. – Raj

相關問題