小编Gre*_*reg的帖子

FMDBBlockSQLiteCallBackFunction应用程序中没有使用makeFunctionNamed的崩溃

我正在开发一个应用程序商店中的应用程序,FMDB用于与其sqlite数据库进行交互.我们收到了一些崩溃报告,堆栈跟踪如下:

Thread : Crashed: NSOperationQueue 0x170239c20 :: NSOperation 0x17024d7d0 (QOS: LEGACY)
0  libobjc.A.dylib                0x000000019701c0b4 objc_retain + 20
1  MyApp                          0x00000001002bdff4 FMDBBlockSQLiteCallBackFunction
2  MyApp                          0x00000001002bdb1c FMDBBlockSQLiteCallBackFunction
3  MyApp                          0x00000001002b66b4 FMDBBlockSQLiteCallBackFunction
4  MyApp                          0x00000001002980fc FMDBBlockSQLiteCallBackFunction
5  MyApp                          0x000000010029f20c FMDBBlockSQLiteCallBackFunction
6  CFNetwork                      0x00000001851475a4 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 300
7  Foundation                     0x00000001866bf1c4 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
8  Foundation                     0x0000000186610604 -[NSBlockOperation main] + 96
9  Foundation                     0x00000001866001cc -[__NSOperationInternal _start:] + 636
10 Foundation                     0x00000001866c1f28 __NSOQSchedule_f + 228
11 libdispatch.dylib              0x0000000197655954 _dispatch_client_callout + 16
12 libdispatch.dylib …
Run Code Online (Sandbox Code Playgroud)

sqlite fmdb ios

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

为什么UIViewController在UINavigationBar下扩展,而UITableViewController却没有?

UITabbarControllerUINavigationController它.我有一个子类UIView,我分配的viewUIViewControllernavController.这是非常标准的东西,对吗?我就是这样做的

_productCategoryView = [[ProductCategoryView alloc] initWithFrame:self.view.frame];
self.view = _productCategoryView;
Run Code Online (Sandbox Code Playgroud)

viewUITableView作为subView

_productCategoryTableView = [[UITableView alloc] initWithFrame:self.frame style:UITableViewStylePlain];
_productCategoryTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_productCategoryTableView.backgroundColor = [UIColor clearColor];
[self addSubview:_productCategoryTableView];
Run Code Online (Sandbox Code Playgroud)

为了调试我正在设置self.backgroundColor = [UIColor blueColor]视图.

从上面的初始化tableView可能会认为视图和表的frame相同.然而,当我进入时iOS 7,视图的原点设置在后面UINavigationBar.这是可以理解的,因为我self.navigationBar.translucent = YES;在我的子类中设置UINavigationController.但我不明白的是桌子是怎么坐在下面的navBar?难道它也不应该从(0, 0)哪个开始navBar?见Scenario 1下面的截图.注意背后的蓝色色调navBar

场景1

现在,我在导航堆栈上的push另一个viewController,只需使用 …

layout objective-c uiview ios ios7

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

如何显示所有localStorage保存的变量?

我想访问保存在特定页面上的所有localStorage变量.我怎么做?我想展示它就像我将使用join()函数显示一个数组

javascript html5 local-storage

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

焦点和模糊的jquery背景颜色变化

我有以下问题:我有一个带有三个文本输入字段的表单,我想在其中一个字段具有焦点时更改背景颜色,并在失去焦点时将其设置回.我想出了以下代码:

HTML(简化):

<form>
<input class="calc_input" type="text" name="start_date" id="start_date" />
<input class="calc_input" type="text" name="end_date" id="end_date" />
<input class="calc_input" size="8" type="text" name="leap_year" id="leap_year" />
</form>
Run Code Online (Sandbox Code Playgroud)

jQuery的

$(document).ready(function() {
    $('input:text').focus(
    function(){
        $(this).css({'background-color' : '#FFFFEEE'});
    });

    $('input:text').blur(
    function(){
        $(this).css({'background-color' : '#DFD8D1'});
    });
});
Run Code Online (Sandbox Code Playgroud)

谢谢

jquery input background-color

25
推荐指数
3
解决办法
10万
查看次数

如何在带有格式参数的字符串中使用html样式?

在我的应用程序中,我想在strings.xml中定义一个看起来像这样的格式字符串(注意<b>...</b>标记):

<string name="location"><b>Location:</b> %1$s</string>
Run Code Online (Sandbox Code Playgroud)

然后使用getString(int,Object ...)替换格式参数:

String formattedString = getString(R.string.location, "Edmonton, AB");
Run Code Online (Sandbox Code Playgroud)

这会产生一个值"Location: Edmonton, AB".我想得到一个值"<b>Location:</b> Edmonton, AB".

有没有办法在strings.xml中使用字符串格式,而不将其分成两个字符串?

java android

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

在给定NDB游标的情况下获取上一页结果的正确方法是什么?

我正在努力通过GAE提供API,允许用户通过一组实体向前和向后翻页.我已经在NDB查询文档页面上查看了有关游标部分,其中包含一些示例代码,这些代码描述了如何在查询结果中向后翻页,但它似乎并没有按预期工作.我正在使用GAE Development SDK 1.8.8.

这是该示例的修改版本,它创建5个示例实体,获取并打印第一页,向前进入并打印第二页,然后尝试向后退步并再次打印第一页:

import pprint
from google.appengine.ext import ndb

class Bar(ndb.Model):
    foo = ndb.StringProperty()

#ndb.put_multi([Bar(foo="a"), Bar(foo="b"), Bar(foo="c"), Bar(foo="d"), Bar(foo="e")])

# Set up.
q = Bar.query()
q_forward = q.order(Bar.foo)
q_reverse = q.order(-Bar.foo)

# Fetch the first page.
bars1, cursor1, more1 = q_forward.fetch_page(2)
pprint.pprint(bars1)

# Fetch the next (2nd) page.
bars2, cursor2, more2 = q_forward.fetch_page(2, start_cursor=cursor1)
pprint.pprint(bars2)

# Fetch the previous page.
rev_cursor2 = cursor2.reversed()
bars3, cursor3, more3 = q_reverse.fetch_page(2, start_cursor=rev_cursor2)
pprint.pprint(bars3)
Run Code Online (Sandbox Code Playgroud)

(仅供参考,您可以在本地应用引擎的交互式控制台中运行上述内容.)

上面的代码打印出以下结果; …

python google-app-engine app-engine-ndb google-cloud-datastore

14
推荐指数
2
解决办法
2284
查看次数

当另一个版本在审核队列中时,是否可以提交新的testflight版本?

我正在处理的应用程序版本1.0.1正在等待审核.我们使用应用程序加载器提交了版本1.0.2的版本,目的是使其作为测试人员的预发布版本,而1.0.1在队列中.一两个小时后,我们收到一封电子邮件,说1.0.1版本被开发者拒绝了.

有没有办法在审查队列中有一个版本,而我们的测试人员通过testflight beta发行版测试下一个版本作为预发布版本?

itunesconnect beta-testing testflight

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

我可以使用AVAudioEngine从文件读取,使用音频单元处理并写入文件,比实时更快吗?

我正在开发一个iOS应用程序,它使用AVAudioEngine进行各种操作,包括将音频录制到文件,使用音频单元对音频应用效果,以及播放应用效果的音频.我使用tap也将输出写入文件.完成此操作后,它会在播放音频时实时写入文件.

是否可以设置AVAudioEngine图形,该图形从文件读取,使用音频单元处理声音,并输出到文件,但比实时更快(即,与硬件可以处理的速度一样快)?用于此的用例是输出几分钟的音频并应用效果,我当然不希望等待几分钟来处理它.

编辑:这是我用来设置AVAudioEngine图表的代码,并播放声音文件:

AVAudioEngine* engine = [[AVAudioEngine alloc] init];

AVAudioPlayerNode* player = [[AVAudioPlayerNode alloc] init];
[engine attachNode:player];

self.player = player;
self.engine = engine;

if (!self.distortionEffect) {
    self.distortionEffect = [[AVAudioUnitDistortion alloc] init];
    [self.engine attachNode:self.distortionEffect];
    [self.engine connect:self.player to:self.distortionEffect format:[self.distortionEffect outputFormatForBus:0]];
    AVAudioMixerNode* mixer = [self.engine mainMixerNode];
    [self.engine connect:self.distortionEffect to:mixer format:[mixer outputFormatForBus:0]];
}

[self.distortionEffect loadFactoryPreset:AVAudioUnitDistortionPresetDrumsBitBrush];

NSError* error;
if (![self.engine startAndReturnError:&error]) {
    NSLog(@"error: %@", error);
} else {
    NSURL* fileURL = [[NSBundle mainBundle] URLForResource:@"test2" withExtension:@"mp3"];
    AVAudioFile* file = [[AVAudioFile alloc] initForReading:fileURL error:&error];

    if (error) …
Run Code Online (Sandbox Code Playgroud)

audiounit ios avaudioengine

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

无法在Internet Explorer 10上加载Google Cloud Endpoints

我正在使用Google JavaScript客户端库加载一些通过Google Cloud Endpoints公开的API 的网站上工作.端点是用Python开发的,但我不确定这是否是一个因素.一切都在Chrome,Firefox和Safari中运行良好,但在Internet Explorer 10上我收到此错误:

SCRIPT5007: Unable to get property 'value' of undefined or null reference 
proxy.html, line 7 character 51
Run Code Online (Sandbox Code Playgroud)

我正在使用类似于Google在其文档建议的代码加载客户端库:

<script type="text/javascript">
    Oversee.Init();
    function init() {
        console.log("starting to load endpoints");
        gapi.client.load("marketplace", "1", function() {
            console.log("finished loading endpoints");
        }, "//" + window.location.host + "/_ah/api");
    }
</script>
<script type="text/javascript" src="https://apis.google.com/js/client.js?onload=init"></script>
Run Code Online (Sandbox Code Playgroud)

这将在控制台上输出以下内容:

starting to load endpoints 
SCRIPT5007: Unable to get property 'value' of undefined or null reference 
proxy.html, line 7 character …
Run Code Online (Sandbox Code Playgroud)

javascript google-app-engine internet-explorer internet-explorer-10 google-cloud-endpoints

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

可能导致此iOS MediaPlayer崩溃的原因是什么?

我们收到了一些崩溃报告,其中包含很难解读的堆栈跟踪.堆栈跟踪完全在MediaPlayer,Foundation,CoreFoundation和libsystem_c.dylib中.遗憾的是,我们无法在任何开发设备上重现,因此故障排除存在问题.

这是堆栈跟踪的示例.有没有人见过这样的事情,或者有什么可能导致这次崩溃的指针?

EXC_BAD_ACCESS KERN_PROTECTION_FAILURE at 0x000000016fc47fe0
Thread : Crashed: com.apple.main-thread
0   libsystem_c.dylib              0x0000000196a0624c localeconv_l
1   libsystem_c.dylib              0x0000000196a55d6c __vfprintf + 108
2   libsystem_c.dylib              0x0000000196a73680 __v2printf + 588
3   libsystem_c.dylib              0x0000000196a0620c _vsnprintf + 304
4   libsystem_c.dylib              0x0000000196a06c58 snprintf_l + 24
5   CoreFoundation                 0x000000018462b01c __CFStringAppendFormatCore + 11584
6   CoreFoundation                 0x00000001846282a4 _CFStringCreateWithFormatAndArgumentsAux2 + 248
7   Foundation                     0x000000018546e448 -[NSPlaceholderString initWithFormat:locale:arguments:] + 172
8   Foundation                     0x000000018546e308 +[NSString stringWithFormat:] + 76
9   MediaPlayer                    0x00000001869bf524 -[NSObject(MPLogDescription) MP_shortDescription] + 96
10  MediaPlayer                    0x00000001869bf598 -[AVPlayerItem(MPLogDescription) MP_shortDescription] + 72
11  MediaPlayer …
Run Code Online (Sandbox Code Playgroud)

objective-c media-player ios ios8

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