如果我在VS 2013中设置了Xamarin.Forms解决方案并尝试运行iOS版本,则会因以下错误而失败:
错误2无法解析引用:/ Users/Koray/Library/Caches/Xamarin/mtbs/builds/WalkiOS/aae389efbebffd5cd3625dcf99aad02c/C:/ Program Files(x86)/ Reference Assemblies/Microsoft/Framework/Xamarin.iOS/v1.0/Facades/System.Collections.Concurrent.dll Walk.iOS
Visual Studio的Xamarin构建主机已经建立,几周前它运行良好.我找不到任何修复错误的方法.
我有这样的数据库模型:
Post
has_many :votes
belongs_to :user
User
has_many :posts
has_many :votes
Vote
belongs_to :post
belongs_to :user
Run Code Online (Sandbox Code Playgroud)
我想要的是查询posts他尚未投票的特定用户.
我试过这样的:
Post.left_outer_joins(:votes).where.not(votes: { user_id: 1 })
Run Code Online (Sandbox Code Playgroud)
其中1只是一个示例用户ID.
问题是,这个查询好像获取所有posts这至少有一票的地方user_id不是1.
但由于不止一个用户会投票支持这些帖子,一旦有多个投票,所有用户现在都会收到所有帖子.
我不知道是否joins是正确的方法,但我的查询将是:
给我所有帖子,其中没有一个投票的user_id为1
是否有可能只posts为他尚未投票的用户提取?
编辑:
我上面三个表的数据库模式:
投票:
CREATE TABLE "votes" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
"post_id" integer,
"user_id" integer,
"created_at" datetime NOT NULL,
"updated_at" datetime NOT NULL,
"vote_type" integer DEFAULT 0);
CREATE INDEX "index_votes_on_post_id" ON "votes" ("post_id");
CREATE INDEX …Run Code Online (Sandbox Code Playgroud) 我目前正在使用以客观c编写的cocoapod.在示例中,它们显示了类似的内容:
options.allowedSwipeDirections = MDCSwipeDirectionLeft | MDCSwipeDirectionRight;
Run Code Online (Sandbox Code Playgroud)
我甚至不知道调用这些变量是什么,但我已经在Swift中尝试了以下内容:
options.allowedSwipeDirections = MDCSwipeDirection.Left | MDCSwipeDirection.Right
Run Code Online (Sandbox Code Playgroud)
但编译说 No '|' candidates produce the expected contextual result type 'MDCSwipeDirection'
我如何在Swift中执行此操作?
编辑:
看起来这不是OptionSet一些答案中所说的,她是声明:
/*!
* Contains the directions on which the swipe will be recognized
* Must be set using a OR operator (like MDCSwipeDirectionUp | MDCSwipeDirectionDown)
*/
@property (nonatomic, assign) MDCSwipeDirection allowedSwipeDirections;
Run Code Online (Sandbox Code Playgroud)
就像这样使用:
_allowedSwipeDirections = MDCSwipeDirectionLeft | MDCSwipeDirectionRight;
Run Code Online (Sandbox Code Playgroud) 我正在使用rails和mysql2适配器.我想将所有主要ID和外键更改为64位整数,而不是默认的32位,因为它们现在是我的生产数据库.
这是可行的还是我必须删除数据库,更改结构并再次导入数据?
如果有办法在不丢弃数据库的情况下完成它,即使它是一个黑客,也很高兴知道.
我想在构建时将项目内的资源复制到 jar 中的特定文件夹中。我在我的内部使用此代码pom.xml:
<resource>
<directory>${basedir}/locale</directory>
</resource>
Run Code Online (Sandbox Code Playgroud)
将 locale 目录中的所有文件复制到我的 jar 中。但文件全部复制到jar文件的根目录下,而不是locale文件夹内。
是否可以使用 Maven 将资源复制到导出的 jar 文件中的特定位置?
ios ×2
mysql ×2
ruby ×2
activerecord ×1
c# ×1
java ×1
maven ×1
objective-c ×1
swift ×1
xamarin ×1
xamarin.ios ×1