ios 5 AWS 开发工具包 S3PutObjectRequest

发布于 2024-12-11 04:53:47 字数 1496 浏览 0 评论 0原文

我刚刚将我的应用程序更新到 ios5,下面的代码(在 4x 中工作)现在无法工作 我认为这是因为 UUID,但我改变了它,错误保持不变。我收到的错误如下。非常感谢任何帮助——谢谢,

我设置了一些断点并隔离了错误,我认为错误与 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)

I just updated my app to ios5 and the code below (that was working in 4x) is now not working
I thought it was because of the UUID but i changed that and the error stayed the same. The error I am getting is below. Any help is greatly appreciated -- thx

I setup some breakpoints and isolated the error and i think the error is with localPutObjectRequest but after looking at what that line does the error message does not make sense to me.

- (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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别低头,皇冠会掉 2024-12-18 04:53:47

从您的帖子来看,错误在于

[[UIDevice currentDevice] uniqueIdentifier]

The method UIDevice uniqueIdentifier is deprecated in iOS 5 and Should not be call.从你的代码中我真的看不出你到底想做什么,但是这篇文章
UIDevice uniqueIdentifier 已弃用 - 现在该怎么办?

应该有助于克服已弃用的方法。您应该更改已弃用的调用,并使用上面帖子中列出的调用。那应该可以解决问题。

Judging from your post, the error lies in

[[UIDevice currentDevice] uniqueIdentifier]

The method UIDevice uniqueIdentifier is deprecated in iOS 5 and should not be called. From your code I cant really see what exactly you are trying to do but this post
UIDevice uniqueIdentifier Deprecated - What To Do Now?

should be helpful in overcoming the deprecated method. You should change the deprecated calls and also use the ones listed in the post above. That should do the trick.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文