有人有诊断这些崩溃的经验吗?我有一个用户一致地得到它们,虽然我找到了一个iOS相关帖子,但我的应用程序并没有崩溃在相同类型的操作上......
我有一个应用程序,我需要在启动时运行,我转换为沙盒.
我有一个帮助应用程序创建,并且当我不编码签名我的应用程序时工作正常.
对于协同设计,看起来我必须创建配置文件 - 一个用于帮助程序,一个用于实际应用程序.
由于这些不匹配,我不能让两者匹配,并且我无法让帮助应用程序启动主应用程序.
我试图重新签署帮助:
codesign -f -vv -s"第三方Mac开发人员应用程序:" - i"com.mydomain.myhelper"--entitlements myhelper/myhelper.entitlements myhelper.app
并获得错误:目标文件格式无法识别,无效或不适合
我从头开始重新创建了帮助程序,没有任何结果.
我该怎么做这个帮助应用程序并让它签名?似乎没有关于此过程的文档.
我在我的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) 执行此行时,我在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.
我想将到期日期“硬编码”到我的测试版代码中。现在我手动计算 unix 日期并将其与当前日期时间进行比较:
if([[NSDate date] timeIntervalSince1970]>1422748800) mustHalt = TRUE;
Run Code Online (Sandbox Code Playgroud)
我想要一种1422748800
用宏替换 的方法,该宏在编译时生成未来 90 天的日期的等效数字。
有什么建议么?
线程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)
这是行不通的.