小编Edw*_*ord的帖子

73
推荐指数
3
解决办法
5万
查看次数

当嵌套在uitableviewcell中时重新加载可见的uicollectionviewcell

我有一个UICollection,显示锁定到未登录用户的单元格上的挂锁.用户可以查看集合,然后以模态登录.当模态解散时,我试图重新加载表格的单元格和嵌套集合以从单元格中移除挂锁.

移除挂锁后,可见细胞不清爽.滚动集合时,屏幕外的单元格正确并显示挂锁.我在tableview和每个嵌套的collectionview上调用reloaddata().

我的代码分为:

的UIViewController

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

    let cell = tableView.dequeueReusableCellWithIdentifier("SectionWorkouts", forIndexPath: indexPath) as! SectionTableViewCell

        cell.delegate = self

        // Return the workouts count from the section
        let intIndex = indexPath.row

        let index = workoutSections.startIndex.advancedBy(intIndex)

        let currentWorkoutSectionKey = workoutSections.keys[index]

        if let currentWorkoutSection = workoutSections[currentWorkoutSectionKey] {

            cell.workoutsCollection.dataSource = sectionWorkoutsCell
            cell.workoutsCollection.delegate = sectionWorkoutsCell

            cell.updateCellWithWorkouts(currentWorkoutSectionKey, workouts: currentWorkoutSection)


        }

    }

    return cell
}
Run Code Online (Sandbox Code Playgroud)

的UITableViewCell

class SectionTableViewCell: UITableViewCell,UICollectionViewDelegate, UICollectionViewDataSource {

    var workouts = [Workout]()
    var delegate: WorkoutCellDelegate?

    @IBOutlet weak …
Run Code Online (Sandbox Code Playgroud)

uitableview ios uicollectionviewcell swift

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

如何提高ARKit的相机质量

我正在构建一个ARKit应用程序,我们希望能够拍摄场景照片.我发现ARCamera视图的图像质量不足以在iPad Pro上拍照.

标准相机图像: 标准相机图像

ARCamera图片: ARCamera图像

我看过一个Apple论坛帖子,提到这可能是iPad Pro 10.5特定的,并且与固定镜头位置有关(https://forums.developer.apple.com/message/262950#262950).

是否有改变设置的公共方式?

或者,我尝试使用AVCaptureSession拍摄普通照片并将其应用于在拍摄照片时sceneView.scene.background.contents切换出模糊图像以获得更高分辨率的图像,但无法使AVCapturePhotoOutput与ARKit一起使用

swift ios11 arkit

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

Simple_form错误 - ActiveRecord :: Relation:Class的未定义方法`model_name'

我试图通过将params传递到where来为我的编辑操作添加一些条件逻辑.

每当我使用.find(params [:id]以外的任何东西时,ActiveRecord :: Relation:Class的错误未定义方法`model_name'

我的代码如下

控制器:

def edit
   @office = Office.where("id = ? AND company_id = ?", params[:id], @company.id )
end
Run Code Online (Sandbox Code Playgroud)

视图:

<%= simple_form_for @office, :url => settings_office_path, :html => { :class => "office_form" } do |f| %>
  <h1>Edit <%= @office.office_name %> Details</h1>
  <%= render :partial => 'form', :locals => { :f => f } %>
<% end %>
Run Code Online (Sandbox Code Playgroud)

我输出了@office的类,它是ActiveRecord :: Relation.如果我只是用

@office = Office.find(params[:id])
Run Code Online (Sandbox Code Playgroud)

输出是Office.

我认为这是问题,但不知道如何解决它.有任何想法吗?

forms ruby-on-rails

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

Gemfile.lock上的权限被拒绝

我通过Capistrano在Passenger上部署我的应用程序时遇到了问题.

我似乎无法摆脱Bundler/definition.rb中的Permission denied - /path/to/app/Gemfile.lock.以前有人这么做过吗?

我已经尝试过chmoding和chowning文件,但这没有帮助.

还有其他人有问题吗?

回溯是

/usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/definition.rb 184 in `initialize'
/usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/definition.rb 184 in `open'
/usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/definition.rb 184 in `lock'
/usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/environment.rb 39 in `lock'
/usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler/runtime.rb 35 in `setup'
/usr/local/rvm/gems/ruby-1.9.2-head/gems/bundler-1.0.0/lib/bundler.rb 100 in `setup'
Run Code Online (Sandbox Code Playgroud)

更新:查看以下链接后 - 在这里,我设法通过捆绑dev然后重新发送Gemfile.lock来解决问题.

bundle ruby-on-rails permission-denied

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

黄瓜长度?

我正在为多步注册过程创建一个Cucumber测试,并且对于场景步骤的最佳实践有点不确定......

注册中有4个表格/页面.我应该在一个场景中循环使用Given,When&Then 4次,还是有更好的方法来组织它?

到目前为止,我有......

Scenario: Company User
Given I am on the registration page
When I follow "Register as a supplier"
When I fill in the following:
  | user_email | test@test.com |
  | user_password | secret |
  | user_password_confirmation | secret |
And I press "Create login - Proceed to step 2"
Then I should see "Create Company Profile"
When I fill in the following:
  | company_name | Test Company |
  | company_description | Lorem |
  | company_telephone | 01928740436 …
Run Code Online (Sandbox Code Playgroud)

testing ruby-on-rails cucumber

5
推荐指数
2
解决办法
295
查看次数