小编tai*_*lec的帖子

pushViewController和showViewController之间的区别

UINavigationController上的pushViewController和showViewController方法有什么区别?

uiviewcontroller uinavigationcontroller ios

19
推荐指数
1
解决办法
7303
查看次数

在Cocoa Touch Framework中包装静态库

我有一个带有2个架构片的胖静态库(armv7,arm64).我正在尝试使用swift并将其包装到Cocoa Touch Framework中.

我所做的:

  1. 创建Cocoa Touch Framework项目
  2. 使用标题拖动.a静态库
  3. 设置OTHER_LDFLAGS-all_load
  4. 设置ONLY_ACTIVE_ARCHNO
  5. 设置VALID_ARCHSARCHSarmv7arm64
  6. 使用Release构建配置构建
  7. 从DerivedData获取.framework文件/../../产品/

当我把这个.framework放到我的swift项目中时,在我的目标常规设置中添加嵌入式二进制文件部分,导入框架并使用其中一个类,我得到undefined symbols for architecture arm64或者undefined symbols for architecture armv7.

编辑:
不确定它是否有帮助,但我注意到静态库的大小约为34MB,但生成的.framework的大小约为12MB.

编辑2:
nm -arch arm64 -g myLibraryName在静态库和生成的动态库上运行.动态库不包含静态库具有的所有符号.看起来像XCode构建过程剥离了很多.

xcode cocoa-touch objective-c ios swift

12
推荐指数
1
解决办法
2011
查看次数

谷歌地图1.10.1 iOS与cocoapods给出重复的符号错误

我正在尝试整合新的GoogleMaps sdk 1.10.1,然后我从https://developers.google.com/maps/documentation/ios/start快速入门

但我收到以下错误,我遇到了重复的符号错误.

GoogleMaps(ResourceContext.o)
duplicate symbol __ZN7gmscore8renderer14DepthMaskStateC1Eb in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(DepthMaskState.o)
duplicate symbol __ZN7gmscore8renderer14DepthMaskStateC2Eb in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(DepthMaskState.o)
duplicate symbol __ZN7gmscore8renderer14DepthMaskStateD0Ev in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(DepthMaskState.o)
duplicate symbol __ZN7gmscore8renderer14DepthMaskStateD1Ev in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(DepthMaskState.o)
duplicate symbol __ZN7gmscore8renderer14DepthMaskStateD2Ev in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(DepthMaskState.o)
duplicate symbol __ZNK7gmscore8renderer14DepthMaskState11StringValueEv in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(DepthMaskState.o)
duplicate symbol __ZNK7gmscore8renderer14DepthMaskState7PreDrawEPNS0_14EntityRendererERKNS_4base10reffed_ptrINS0_11EntityStateEEE in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(DepthMaskState.o)
duplicate symbol __ZNK7gmscore8renderer14DepthMaskState8PostDrawEPNS0_14EntityRendererERKNS_4base10reffed_ptrINS0_11EntityStateEEE in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(DepthMaskState.o)
duplicate symbol __ZTVN7gmscore8renderer14DepthMaskStateE in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(DepthMaskState.o)
duplicate symbol __ZN7gmscore8renderer15GLScopedContextC1EP15GMSIOSGLContext in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(GLScopedContext.o)
duplicate symbol __ZN7gmscore8renderer15GLScopedContextC2EP15GMSIOSGLContext in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(GLScopedContext.o)
duplicate symbol __ZN7gmscore8renderer15GLScopedContextD1Ev in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(GLScopedContext.o)
duplicate symbol __ZN7gmscore8renderer15GLScopedContextD2Ev in:
    /Users/klouddata/Documents/SVN_RIL/RTSS_iOS_B200/Pods/GoogleMaps/Frameworks/GoogleMaps.framework/GoogleMaps(GLScopedContext.o)
ld: 706 duplicate symbols for architecture i386 …
Run Code Online (Sandbox Code Playgroud)

ios cocoapods google-maps-sdk-ios

11
推荐指数
2
解决办法
1878
查看次数

如何使用自动布局为多个UILabel填充UITableViewCell

我有一个UITableViewCell包含一些UILabel,我希望这个标签水平填充的宽度,UITableViewCell并不是大空间而不是其他,这是一个例子:

|---------------------------------------------------------
|                                                        |
|***This is a uilabel***This is a uilabel***label***lb** |
|                                                        |
|---------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

因此,对于不同的UILabel宽度我希望所有UILabel填充所有UITableViewCell固定字体大小,如果需要,*是间距,我如何通过自动布局实现这一点?

objective-c uitableview ios autolayout

2
推荐指数
1
解决办法
205
查看次数

Objective-C语法问题

我在这个博客上发现了这个代码http://themainthread.com/blog/2014/02/building-a-universal-app.html

static void initSimpleView(SimpleView *self) {
    // Configure default properties of your view and initialize any subviews
    self.backgroundColor = [UIColor clearColor];

    self.imageView = ({
        UIImageView *imageView = [[UIImageView alloc] init];
        imageView.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:imageView];
        imageView;
    });

    self.label = ({
        UILabel *label = [[UILabel alloc] init];
        label.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:label];
        label;
    });
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        initSimpleView(self);
    }
    return self;
}
Run Code Online (Sandbox Code Playgroud)

它是如何工作的?是什么意思static void initWithSimpleView(SimpleView *self)?为什么imageViewlabel在某种块的初始化?

c static objective-c ios objective-c-blocks

1
推荐指数
1
解决办法
79
查看次数