小编Nik*_*iko的帖子

17
推荐指数
1
解决办法
2730
查看次数

Cordova无法加载资源:net :: ERR_FILE_NOT_FOUND

我在Visual Studio 2015中使用cordova.我的代码正在使用ripple正确.但是,它无法使用我的手机(调试模式).我收到此错误消息.

Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///android_asset/veriler/icerik2.json (Error)
Run Code Online (Sandbox Code Playgroud)

我认为应该是

file:///android_asset/www/veriler/icerik2.json
Run Code Online (Sandbox Code Playgroud)

我无法解决这个问题.我该怎么做才能到达这个json文件.

file cordova visual-studio-2015

15
推荐指数
1
解决办法
2404
查看次数

一个XIB用于多个UITableViewCell子类

我正在尝试将一个XIB文件用于多种类型的自定义UITableViewCell子类(相同的IBOutlets - 相同的外观 - 不同的方法和逻辑).

我怎样才能做到这一点?

objective-c uitableview xib custom-cell ios

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

针对Cordova插件中的自定义框架定位特定平台

我正在为Android开发一个包含自定义框架的Cordova插件,其中一个仅与cordova-android> = 4.0.0兼容.

我知道在plugin.xml文件中我们可以针对cordova-android特定版本,但这适用于整个平台的插件.

这是我的简短版本plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="com.plugin.MyPlugin" version="1.0">
    <name>MyPlugin</name>

    <engines>
        <engine name="cordova-android" version=">=4.0.0" />
    </engines>

    <js-module src="www/MyPlugin.js" name="MyPlugin">
        <clobbers target="MyPlugin" />
    </js-module>

    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="MyPlugin">
                <param name="android-package" value="com.plugin.MyPlugin" />
            </feature>
        </config-file>

        <source-file src="src/android/MyPlugin.java" target-dir="src/com/plugin/MyPlugin" />

        <framework src="path/to/first-framework" custom="true" />
        <framework src="path/to/second-framework" custom="true" />
    </platform>
</plugin>
Run Code Online (Sandbox Code Playgroud)

这里,名为"first-framework"的框架仅适用于cordova-android <4.0.0,而"second-framework"仅适用于cordova-android> = 4.0.0.

基本上我的目标是只有一个plugin.xml文件声明:

  • 如果cordova-android是<4.0.0:使用"first-framework"
  • 否则,如果cordova-android是> = 4.0.0:使用"second-framework"

我怎么能这样做?

谢谢

android frameworks plugin.xml cordova cordova-plugins

6
推荐指数
0
解决办法
375
查看次数

输入第一个字符时UISearchBar无法正常工作?

我会在我的应用程序中实现SearchBar概念,但它有一个错误,当我输入搜索栏中的第一个字符时它不工作而tableview没有显示相关字段,它显示空tableview但我输入第二个字符显示相关字段在tableview中,我不知道是什么错误让我请帮帮我.

我在这里给出了我的代码.

-(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{
       NSLog(@"searching::");
       if(searchBar.text.length == 0)
       {
            [searchDict removeAllObjects];
            [arrayDict removeAllObjects];
            searchDict=[[NSMutableArray alloc]init];
            arrayDict=[[NSMutableArray alloc]init];
            [self getJsonResponse];
            [self.tableView reloadData];    
       } else {
            [arrayDict removeAllObjects];
            arrayDict=[[NSMutableArray alloc]init];
       }
       dispatch_async(dispatch_get_main_queue(), ^{
       [self getSearchJsonResponse:searchBar.text];
       NSLog(@"searchDict::%@",searchDict);
       [self.tableView reloadData];
   });    
}
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview uisearchbar ios

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

如何设置UIDatePickerModeCountDownTimer的最长时间?

我想问一下如何设置iOS Count Down Timer的最长时间?(例如,最多1小时30分钟)

倒计时器从UIDatePicker模式开始:

的UIDatePicker

谢谢!

编辑:

有人说我必须设置最小/最大日期,我只是在故事板中设置它们但我没有看到任何区别:

(设置时间是我当地时间+ - 30分钟)

最大/最小时间设置

编辑:

来自Apple:

倒数计时器模式(UIDatePickerModeCountDownTimer)中也会忽略最小和最大日期.

无论如何他们这样做呢?

uidatepicker ios swift

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

不推荐使用 mediaPlaybackRequiresUserAction 和 iOS 9

WKWebViewConfiguration

WKWebViewConfiguration

所以这是我的问题:

因为mediaPlaybackRequiresUserActioniOS 9 已弃用,mediaTypesRequiringUserActionForPlayback仅适用于 iOS 10+,我可以为 iOS 9 使用什么?

wkwebview wkwebviewconfiguration ios9

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

结束一天约会的巧妙方法?

我在数据库中查询startDate和endDate之间的值.因此,我正在寻找一种巧妙的方式来获得NSDate以结束一天的约会.就像你可以获得startOfDayForDate()一样.

我想你可以这样做:

let cal = NSCalendar.currentCalendar()
let startOfDay = cal.startOfDayForDate(NSDate())
let aDay:NSTimeInterval = 60*60*23 + 60*59 + 59
let endofDay = startOfDay.dateByAddingTimeInterval(aDay)
Run Code Online (Sandbox Code Playgroud)

将component.day + 1添加到startOfDayForDate是获取日期"当天结束"的正确方法,还是有更好的方法?

nscalendar nstimeinterval ios

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

iOS Swift - 某些设备上的EXC_BAD_INSTRUCTION

我是Swift和iOS开发的新手,但我遇到了一个错误,导致我的应用程序在以下设备上运行时崩溃:

iPhone 4S iPhone 5 iPad 2 iPad Retina

这是被标记的代码:

// bin2dec - converts binary string into decimal string
func bin2dec(input: String) -> String {
    var counter = countElements(input)
    var digit: Character
    var power = 1
    var result = 0

    while counter > 0 {
        digit = input[advance(input.startIndex, counter-1)]

        switch digit {
        case "0":
            result += 0
        case "1":
            result += 1 * power
        default:
            power = power / 2
            break
        }
        counter--
        power *= 2
    }
    return "\(result)"
} …
Run Code Online (Sandbox Code Playgroud)

crash ios exc-bad-instruction swift

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