我想创建一个为模拟器和设备构建的输出框架的私有cocoapod.
我创建了一个Cocoa触摸框架,其中我使用Cocoapods集成了CocoaLumberjack.我想为所有可能的架构(模拟器和设备)构建框架.
默认情况下,构建设置,
'Build Active Architectures Only' is set to (Debug - Yes, Release - No).
Run Code Online (Sandbox Code Playgroud)
只要我将debug的此设置设置为No,构建就会失败,并显示以下链接器错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_DDASLLogger", referenced from:
objc-class-ref in MyManager.o
"_OBJC_CLASS_$_DDLog", referenced from:
objc-class-ref in MyManager.o
"_OBJC_CLASS_$_DDTTYLogger", referenced from:
objc-class-ref in MyManager.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
我知道CocoaLumberjack仅适用于调试版本中的活动架构.
因此,我将用于调试的Build active架构切换回Yes,并成功构建框架.
为了构建所有架构的框架,我使用在Build阶段添加的运行脚本,该脚本还声称将ios-device和ios-simulator构建合并为一个.这是脚本:
set -e
set +u
# Avoid recursively calling this script.
if [[ $SF_MASTER_SCRIPT_RUNNING ]]
then …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个共享应用程序扩展,并遵循此来源的教程:
http://www.technetexperts.com/mobile/share-extension-in-ios-application-overview-with-example/
Run Code Online (Sandbox Code Playgroud)
我正在使用XCode 8.0(8A218a)在模拟器上它按预期工作.在我的iPhone 5s上使用iOS 9.3.3.
我首先安装容器应用程序,然后在XCode询问"选择要运行的应用程序"时选择照片应用程序来运行扩展程序.
现在,当我在扩展程序运行时打开照片时,会出现以下错误:
MobileSlideShow[3500:589624] *** error reading settings archive file: <ISRootSettings:
/var/mobile/Documents/com.apple.mobileslideshow.settings/ISRootSettings_10.plist>
Run Code Online (Sandbox Code Playgroud)
现在,当我点击"共享"按钮时,我的容器应用程序不会出现在能够共享图片的应用程序列表中.
编辑: 我正在分享一些代码:
ShareViewController.m
@implementation ShareViewController
- (BOOL)isContentValid {
// Do validation of contentText and/or NSExtensionContext attachments here
return YES;
}
- (void)didSelectPost {
for (NSItemProvider* itemProvider in ((NSExtensionItem*)self.extensionContext.inputItems[0]).attachments ) {
if([itemProvider hasItemConformingToTypeIdentifier:@"public.jpeg"]) {
NSLog(@"itemprovider = %@", itemProvider);
[itemProvider loadItemForTypeIdentifier:@"public.jpeg" options:nil completionHandler: ^(id<NSSecureCoding> item, NSError *error) {
NSData *imgData;
if([(NSObject*)item isKindOfClass:[NSURL class]]) {
imgData = [NSData dataWithContentsOfURL:(NSURL*)item];
}
if([(NSObject*)item isKindOfClass:[UIImage class]]) {
imgData …Run Code Online (Sandbox Code Playgroud)