2009-12-13 122 views
0

我正嘗試使用SDK 3.0應用Mike Chen的回答here。在我執行的delegate.m文件中;無iPhone Camera中的Camera _createPreviewImage

[viewController.view addSubview:[[objc_getClass("PLCameraController") sharedInstance] previewView]]; 

和viewcontroller.m我實現:

CapturedImage = [[objc_getClass("PLCameraController") sharedInstance] _createPreviewImage]; 

但CapturedImage始終是零。有什麼建議麼?

回答

0

檢查事項:

(1)具有PLCameraController更新了iPhone 3.x的? This blog post suggest it has not

(2)代替嵌套所有來電Smalltalk的風格打破它們分開,所以你可以看到,如果你讓你覺得你的對象:

WhateverClass *cameraController=[objc_getClass("PLCameraController") sharedInstance]; 
if (cameraController!=nil) { 
    ImageClass *myImage=[cameraController _createPreviewImage]; 
}else { 
    NSLog(@"camerController is nil"); 
} 

只要記住,PLCameraController是依賴於私人框架一個隱藏的Apple API。即使你得到它的工作,你很可能不會通過應用商店評論。