我的帖子是has_and_belongs_to_many :categories
。
我需要这样的东西:
Post.where('here category_ids intersects with custom array [1,2,3]').all
答案 0 :(得分:0)
您可以加入类别和查询类别
NSArray *arrayToBeConvertedInToString = @[@"This", @"is", @"an", @"array"];
NSString * result = [[arrayToBeConvertedInToString valueForKey:@"description"] componentsJoinedByString:@" "];
NSLog(@"Array in string: %@", result);