小编Jer*_*son的帖子

一致的Dispatch队列:com.apple.root.default-qos.overcommit崩溃

有人有诊断这些崩溃的经验吗?我有一个用户一致地得到它们,虽然我找到了一个iOS相关帖子,但我的应用程序并没有崩溃在相同类型的操作上......

crash macos cocoa

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

OSX上Apple Sandbox的代码签名助手应用程序

我有一个应用程序,我需要在启动时运行,我转换为沙盒.

我有一个帮助应用程序创建,并且当我不编码签名我的应用程序时工作正常.

对于协同设计,看起来我必须创建配置文件 - 一个用于帮助程序,一个用于实际应用程序.

由于这些不匹配,我不能让两者匹配,并且我无法让帮助应用程序启动主应用程序.

我试图重新签署帮助:

codesign -f -vv -s"第三方Mac开发人员应用程序:" - i"com.mydomain.myhelper"--entitlements myhelper/myhelper.entitlements myhelper.app

并获得错误:目标文件格式无法识别,无效或不适合

我从头开始重新创建了帮助程序,没有任何结果.

我该怎么做这个帮助应用程序并让它签名?似乎没有关于此过程的文档.

macos xcode sign sandbox helper

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

FMDatabase/SQLite3使用的"打开的文件太多"问题

我在我的OSX App中使用了SQLite3的FMDatabase包装器.我在数据库中做了很多插入:

FMResultSet *results;
results= [db executeQuery:@"select count(*) from `items` where key = ?",[keyPath lowercaseString],nil];

while([results next])
{
    if([results unsignedLongLongIntForColumnIndex:0]>0){
        updateOperation=TRUE;
    }
}
[results close];

if(updateOperation){

    [db executeUpdate:@"update `items` set OSXsize=?,OSXOsize=?, OSXDate=?, UUID=?,sourceFile=?,tombStone=0,SandBoxBookMark=?,songname=?,albumartist=? where key=?",
     size,originalSize, convertedDate,UUID,sourcePath,bookmark,fileName,albumArtist,[keyPath lowercaseString] , nil];
}
else
{
    [db executeUpdate:@"insert into `items`(key,filepath, OSXsize, OSXOsize, OSXdate,UUID,sourceFile,tombStone,SandBoxBookMark,songname,albumartist) values(?,?,?,?,?,?,?,0,?,?,?)",
     [keyPath lowercaseString], dapPath, size,originalSize, convertedDate,UUID,sourcePath,bookmark,fileName,albumArtist, nil];
}
Run Code Online (Sandbox Code Playgroud)

我打开数据库一次,但是,当应用程序在活动监视器中进行时,我看到附加了4725个文件句柄:

/Users/userA/Library/Containers/com.map-pin.Dapper/Data/Library/Application Support/com.map-pin.Dapper/dapperright.sqlite
15
16
...
4724
4725
Run Code Online (Sandbox Code Playgroud)

sqlite macos xcode fmdb

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

使用sqlite3_step(语句)访问不一致但频繁的EXC_BAD_ACCESS访问

执行此行时,我在iOS中频繁出现EXC_BAD_ACCESS崩溃:

while (sqlite3_step(statement) == SQLITE_ROW) {

}
Run Code Online (Sandbox Code Playgroud)

它用于在我的(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 功能中提供结果.

有任何想法吗?SQL等看起来很好,数据库正在后台线程中更新,之后我调用前台线程来更新UI.

sqlite iphone exc-bad-access ios ios5

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

Xcode 日期预处理器宏

我想将到期日期“硬编码”到我的测试版代码中。现在我手动计算 unix 日期并将其与当前日期时间进行比较:

 if([[NSDate date] timeIntervalSince1970]>1422748800) mustHalt = TRUE;
Run Code Online (Sandbox Code Playgroud)

我想要一种1422748800用宏替换 的方法,该宏在编译时生成未来 90 天的日期的等效数字。

有什么建议么?

macros xcode datetime

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

如何以编程方式关闭窗口的NSAlert运行模式

线程1运行模态警报:

- (void)didEndSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
{
[sheet orderOut:self];
};


-(void)newAlert
{
currentAlert=[NSAlert alertWithMessageText:@"Switch drives!" defaultButton:@"Cancel sync" alternateButton:nil otherButton:nil informativeTextWithFormat:@"Please switch disks: %@",reason,nil];
[currentAlert setDelegate:self];
[currentAlert beginSheetModalForWindow:self.window completionHandler:^(NSInteger returnCode)
            {
                mustStop=TRUE;
            }];

}     
Run Code Online (Sandbox Code Playgroud)

在其他地方,在另一个线程上我想解除警报,但这不起作用:

[NSApp endSheet:[self window]];
Run Code Online (Sandbox Code Playgroud)

这是行不通的.

cocoa objective-c

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

标签 统计

macos ×3

xcode ×3

cocoa ×2

sqlite ×2

crash ×1

datetime ×1

exc-bad-access ×1

fmdb ×1

helper ×1

ios ×1

ios5 ×1

iphone ×1

macros ×1

objective-c ×1

sandbox ×1

sign ×1