小编And*_*rew的帖子

在应用程序中接收"尝试导入错误:"

我在尝试运行我的反应应用程序时收到以下错误:

combineReducers

以下是我导出combineReducers的方法:

import { combineReducers } from 'redux';
import userReducers from './userReducers';
import articleReducers from './articleReducers';

export default combineReducers({
    userReducers,
    articleReducers
});
Run Code Online (Sandbox Code Playgroud)

这是我如何导入它App.js:

combineReducers

我如何导出combineReducers有什么不对?

reactjs redux

40
推荐指数
3
解决办法
4万
查看次数

如何浏览我的Heroku数据库?

既然我已经将我的webapp部署到Heroku了,那么随着时间的推移,我将如何浏览数据库?

database heroku heroku-postgres

19
推荐指数
3
解决办法
2万
查看次数

"'nil'不是与ActiveModel兼容的对象.它必须在微博模型中实现:to_partial_path"错误

当我尝试查看用户个人资料页面时,我收到上述错误.

这是我的show.html.erb代码:

<% provide(:title, @user.name) %>

<div class="row">

  <aside class="span4">
    <section>
      <h1>
        <%= gravatar_for @user %>
        <%= @user.name %>
      </h1>
    </section>
  </aside>

  <div class="span8">
    <% if @user.microposts.any? %>
      <h3>Microposts (<%= @user.microposts.count %>)</h3>
      <ol class="microposts">
        <%= render @microposts %>
      </ol>
      <%= will_paginate @microposts %>
    <% end %>
  </div>

</div>
Run Code Online (Sandbox Code Playgroud)

其中<%= render @microposts %>原因造成的问题.

ruby-on-rails activemodel

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

如何以编程方式将UITableView滚动到特定部分

在我的日历应用程序中,我希望我的UITableView根据点击的日期滚动到特定部分.目前的实施如下:

- (void)calendarDidDateSelected:(JTCalendar *)calendar date:(NSDate *)date
{
    // Format NSDate so it can be compared to date selected
    static NSDateFormatter *dateFormatter = nil;
    if(!dateFormatter){
        dateFormatter = [NSDateFormatter new];
        dateFormatter.dateFormat = @"yyyy-MM-dd"; // Read the documentation for dateFormat
    }

    // Set formatted dates
    NSDate *juneSixteenth = [dateFormatter dateFromString:@"2015-06-16"];
    NSDate *juneSeventeenth = [dateFormatter dateFromString:@"2015-06-17"];

    // Set date selected, so agendaTable knows which event to show
    if([juneSixteenth compare:date] == NSOrderedSame){
        NSLog(@"You picked June 16th");
        self.datePicked = [NSNumber numberWithInt:16];
    }
    else if([juneSeventeenth compare:date] == …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios

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

如何使网站按钮打开短信撰写电话号码?

我找到了解决方案,以便当您点击网站上的按钮时,它会链接到一个电话号码,用户手机将打开拨号码,并预先填充该号码.

我想做的是将"撰写邮件"模式中的用户短信应用程序打开到该特定号码.有没有办法做到这一点?我尝试了以下方法,但它在Android上不起作用:

sms://1-516-400-6217
Run Code Online (Sandbox Code Playgroud)

html

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

获取"_utf8_nextCharSafeBody"错误

我正在尝试使用MixPanel的iOS SDK来跟踪用户操作,我在尝试编译时收到以下错误:

   Undefined symbols for architecture x86_64:
      "_utf8_nextCharSafeBody", referenced from:
          _validate_dispatch_data_partial_string in MPWebSocket.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

据我所知,从文档设置说明中,我已正确添加了框架.这个错误消息似乎不是MixPanel独有的,所以我想知道是什么原因造成这种情况,以及我错误地集成了SDK的哪个方面?

objective-c ios mixpanel

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

如何正确格式化此Swift函数以映射数组?

我正在尝试使用swift构建一个函数来映射数组,将数组中的每个值除以3,然后吐出一个新数组.这是我到目前为止:

    func divideby3Map<T, U>(y: [T], z: T -> U) -> [U] {

        let array = [int]()
        let divideby3Array = array.map { [y] / 3 }

        return dividedby3Array
    }

    divideby3Map([1,2,3,4,5])
Run Code Online (Sandbox Code Playgroud)

TU是原始数组,分别返回的新阵列,它的使用泛型来完成.

我确定这不是正确编写的,我坚持正确的语法.例如,由于返回的数组由泛型表示[U],我假设我必须在返回的数组中的某处使用它,但不确定在哪里.

arrays ios swift

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

无法转换'[String]类型的值?' 预期参数类型'String'

我想要做的是将图像设置firstCard为等于图像文件,其名称对应于firstCardString.

例如,在下面的情况下,代码可以设置self.firstCard.image显示名为"卡1",如果它随机挑选它的形象(我已经擦到阵列为简洁休息,充分的事含有52级的对象).

var deckArray = [
        "card1": ["Bear","Ball"],
        "card2": ["Bear","Ball"],
        "card3": ["Bear","Ball"],
        "card4": ["Bear","Ball"],
        "card5": ["Bear","Ball"],
        "card6": ["Bear","Ball"],
        "card7": ["Bear","Ball"],
]

    let firstRandomNumber = Int(arc4random_uniform(52))+1
    let firstCardString = deckArray["card\(firstRandomNumber)"]
    self.firstCard.image = UIImage(named: firstCardString)
Run Code Online (Sandbox Code Playgroud)

相反,我收到以下错误:

无法转换'[String]类型的值?' 预期参数类型'String'

我不完全确定这个错误信息是什么意思,是什么[String]?

swift

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

Heroku 应用程序成功部署,但在加载站点时收到应用程序错误

据我所知,我的日志没有指出任何错误,但是在加载站点时我收到以下错误:

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command heroku logs --tail

您可以在下面找到日志。我在这里错过了什么吗?

-----> Python app detected
-----> Uninstalling stale dependencies
       Uninstalling Django-2.1.5:
         Successfully uninstalled Django-2.1.5
       Uninstalling Pillow-5.4.1:
         Successfully uninstalled Pillow-5.4.1
-----> Installing requirements with pip
       Collecting dj-database-url==0.5.0 (from -r /tmp/build_99fe21a8dcc00005ce600053adc20260/requirements.txt (line 1))
         Downloading https://files.pythonhosted.org/packages/d4/a6/4b8578c1848690d0c307c7c0596af2077536c9ef2a04d42b00fabaa7e49d/dj_database_url-0.5.0-py2.py3-none-any.whl
       Collecting Django==2.1.5 (from -r /tmp/build_99fe21a8dcc00005ce600053adc20260/requirements.txt (line 2))
         Downloading …
Run Code Online (Sandbox Code Playgroud)

python django heroku

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

通过Apple的ToDoList应用程序教程,项目点击不会正确添加"已完成"复选标记.

当我点击一个项目时,它似乎没有注册并在右侧添加一个复选标记.当我点击后续项目时,它会在我之前点击的那个旁边显示一个复选标记,但不会显示我刚刚点击的那个,依此类推,始终保留一个动作.

XYZToDoListViewController.m:

//
//  XYZToDoListViewController.m
//  ToDoList
//
//  Created by Andrew Ghobrial on 2/15/14.
//
//

#import "XYZToDoListViewController.h"
#import "XYZToDoItem.h"

@interface XYZToDoListViewController ()

@property NSMutableArray *toDoItems;

@end

@implementation XYZToDoListViewController

- (void)loadInitialData {
    XYZToDoItem *item1 = [[XYZToDoItem alloc] init];
    item1.itemName = @"Buy milk";
    [self.toDoItems addObject:item1];
    XYZToDoItem *item2 = [[XYZToDoItem alloc] init];
    item2.itemName = @"Buy eggs";
    [self.toDoItems addObject:item2];
    XYZToDoItem *item3 = [[XYZToDoItem alloc] init];
    item3.itemName = @"Read a book";
    [self.toDoItems addObject:item3];
}

 - (IBAction)unwindToList:(UIStoryboardSegue *)segue
{



}

- (id)initWithStyle:(UITableViewStyle)style
{
    self …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios

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