0

我已经下载了最新的 Aviary 代码 2.6.0 并将其合并到我的 Xcode 4.2 中,用于运行 iOS 5.0 的 iPhone 4S。每次我启动 Aviary 操作时,我都会在下面看到 objectAtIndexedSubscript 的回溯显示。

我看到这篇文章“ iOS5中是否提供 objectAtIndexedSubscript? ”并且 iOS 5.0 中没有 objectAtIndexedSubscript。在 Aviary 文档中,它说支持 iOS 5.0。我错过了什么?

所以这是我的问题。有没有人尝试为 iOS 5.0 合并最新的 Aviary 代码版本 2.6.0?如果不是适用于 iOS 5.0 的 Aviary SDK 版本是什么?我在哪里可以下载旧版本的 Aviary SDK。我只是还没准备好迁移到 iOS 6.0。我正在尝试将此错误报告给 Aviary 支持,但我感觉他们会告诉我升级到 iOS 6.0。

来自 Aviary 网站:

运行时要求 SDK 支持的最低 iOS 版本为 iOS 5.0。做出这种选择的主要原因是我们使用了 ARC(自动引用计数)以及我们对许多需要 iOS 5 的 Apple 框架和库的依赖。”

- (void) launchPhotoEditorWithImage:(UIImage *)editingResImage highResolutionImage:(UIImage *)highResImage
{    

    NSLog(@"launchPhotoEditorWithImage ...");

    // Initialize the photo editor and set its delegate
    AFPhotoEditorController * photoEditor = [[AFPhotoEditorController alloc] initWithImage:editingResImage];
    [photoEditor setDelegate:self];

    NSLog(@"Present photo editor ...");

    // Present the photo editor.
    [self presentViewController:photoEditor animated:YES completion:nil];
}

2013-03-31 19:32:14.953 Photo Editor[348:707] launchPhotoEditorWithImage ...
2013-03-31 19:32:15.421 Photo Editor[348:707] Present photo editor ...
2013-03-31 19:32:15.421 Photo Editor[348:3f03] -[__NSArrayM objectAtIndexedSubscript:]: unrecognized selector sent to instance 0x4ac5f0
2013-03-31 19:32:15.432 Photo Editor[348:3f03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM objectAtIndexedSubscript:]: unrecognized selector sent to instance 0x4ac5f0'
*** First throw call stack:
(0x36fbe8bf 0x3232e1e5 0x36fc1acb 0x36fc0945 0x36f1b680 0xb1a45 0x32933d55 0x32935dc7 0x32935c5d 0x32936867 0x37f5c1cf 0x37f5c0a4)
terminate called throwing an exception[Switching to process 9987 thread 0x2703]
[Switching to process 9987 thread 0x2703]
warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.
kill
Current language:  auto; currently objective-c
quit
Program ended with exit code: 0
4

2 回答 2

1

只需更新到最新的 Xcode。在一些旧版本的 Xcode 中,objectAtIndexedSubscript:没有在 SDK 中实现。

于 2013-04-01T02:05:39.520 回答
0

添加这个家伙类别(从 gi​​thub 链接获取),它将完美运行

http://cocoaisland.wordpress.com/2012/08/12/modern-objective-c-part-ii-container-subscripting/

于 2013-04-01T01:24:43.067 回答