ios 5 AWS 开发工具包 S3PutObjectRequest
我刚刚将我的应用程序更新到 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从您的帖子来看,错误在于
The method UIDevice
uniqueIdentifier
is deprecated in iOS 5 and Should not be call.从你的代码中我真的看不出你到底想做什么,但是这篇文章UIDevice uniqueIdentifier 已弃用 - 现在该怎么办?
应该有助于克服已弃用的方法。您应该更改已弃用的调用,并使用上面帖子中列出的调用。那应该可以解决问题。
Judging from your post, the error lies in
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 postUIDevice 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.