2011-10-23 64 views
0

我剛更新我的應用程序到ios5和下面的代碼(這是在4x工作)現在不工作 我認爲這是因爲UUID,但我改變了這一點,錯誤保持不變。我得到的錯誤如下。任何幫助非常感謝 - thxios 5 AWS開發工具包S3PutObjectRequest

我設置了一些斷點和孤立的錯誤,我認爲錯誤是與localPutObjectRequest,但在看了那行後,錯誤消息對我來說沒有意義。

- (void) updateLocation:(CLLocation*)loc 
{ 
    [progressView setProgress:5]; 
    [[LocationManager sharedLocationManager] setDelegate:nil]; 

    uploadPath = [NSString stringWithFormat:@"%@/%@-%f.png", [[UIDevice currentDevice] uniqueIdentifier], [[UIDevice currentDevice] uniqueIdentifier], [[NSDate date] timeIntervalSince1970]]; 

    S3PutObjectRequest *localPutObjectRequest = [[[S3PutObjectRequest alloc] initWithKey:uploadPath inBucket:[NSString stringWithFormat:@"spotted-at"]] autorelease]; 


    localPutObjectRequest.data = UIImagePNGRepresentation([UIImage imageWithData:imageData]); 
    [localPutObjectRequest setDelegate:self]; 

    [[Constants s3] putObject:localPutObjectRequest]; 

} 



2011-10-23 00:45:39.654 spotted.at[4131:707] -[UIButtonContent length]: unrecognized selector sent to instance 0x2c0130 
2011-10-23 00:45:39.656 spotted.at[4131:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIButtonContent length]: unrecognized selector sent to instance 0x2c0130' 
*** First throw call stack: 
(0x310868bf 0x3822b1e5 0x31089acb 0x31088945 0x30fe3680 0x330e42ef 0x330e4267 0x331d7e51 0x49041 0x4973d 0x352c05df 0x352bff81 0x352ba62f 0x3105ab31 0x3105a15f 0x31059381 0x30fdc4dd 0x30fdc3a5 0x33c0afed 0x3304e743 0x453b 0x3f74) 
+0

UIDevice'uniqueIdentifier'已在iOS 5中棄用。 – titaniumdecoy

+1

是的,但這不是問題。 – p01nd3xt3r

回答

-1

從你的文章來看,錯誤在於

[[UIDevice currentDevice] uniqueIdentifier] 

方法的UIDevice uniqueIdentifier iOS 5中已被棄用,不應該被調用。從你的代碼我真的不知道你到底想要做什麼,但這個職位 UIDevice uniqueIdentifier Deprecated - What To Do Now?

應該有助於克服棄用的方法。您應該更改已棄用的呼叫,並使用上述帖子中列出的呼叫。這應該夠了吧。

+0

我已經試過了,它給了我同樣的錯誤。問題不在於上傳路徑與本地放置對象請求。 – p01nd3xt3r

+0

但你的本地put對象請求是從上傳路徑派生的嗎? –

+0

已棄用並不意味着已被刪除。該方法仍然正常工作,不能成爲錯誤的原因。 – Joel

相關問題