代码之家  ›  专栏  ›  技术社区  ›  Will Von Ullrich

链接器命令在域中失败?

  •  0
  • Will Von Ullrich  · 技术社区  · 6 年前

    我已经安装了 Realm 有了豆荚,一切都符合了。我甚至有两个的子类 RLMObjects 用于将自定义类对象保存到领域默认空间的。

    @interface RLNotification : RLMObject
    
    - (instancetype)initWithNotification:(KANotification *)notification;
    
    @property NSString *docID, *userID, *username;
    @property NSInteger time, type;
    
    @end
    
    
    @interface RLProfilePicture : RLMObject
    
    - (instancetype)initWithImage:(UIImage *)image;
    
    @property (nonatomic) NSString *userID;
    @property (nonatomic) NSData *imageData;
    @property NSInteger timeLastUpdated;
    
    
    @end
    

    问题

    但当我要用这些的时候 任何 类,例如:

    NSLog(@"test: %@", [RLNotification allObjects]);
    
    RLNotification *noti = RLNotification.new;
    noti.userID = @"hey";
    noti.username = @"nope!";
    
    [RLMRealm.defaultRealm addObject:noti];
    
    NSLog(@"test2: %@", [RLNotification allObjects]);
    

    我收到这个警告…

    Undefined symbols for architecture arm64:
      "_OBJC_CLASS_$_RLNotification", referenced from:
          objc-class-ref in AnyClassName.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    我到底做错了什么/需要改变什么?…

    1 回复  |  直到 6 年前
        1
  •  1
  •   Will Von Ullrich    6 年前

    这是一个反常的问题。我删除 Realm 从我的pod文件,清洗,去集成,更新可可,安装,整个过程。

    轻松地做了4次,第5次成功了。····


    谢谢可可!酷!