我正在开发一个应用程序,我需要找到已经安装在iPhone,Facebook等iPhone设备上的应用程序.我需要检查一下.如果可能的话,请给我代码片段,否则获得解决方案的链接.有可能吗?
如果这是可能的,那么如何禁用该应用程序...
提前致谢......
我有一张从左到右排列的图表.但是,这个图的某些元素我想要相对于另一个节点定位.例如,如果我有这个图:
digraph "Test" {
rankdir = "LR"
A -> B
B -> C
D -> B
note -> B
note [ shape="house" ]
};
Run Code Online (Sandbox Code Playgroud)
它呈现如下:

但是,我希望"note"节点始终直接位于它指向的节点下面,就像这个(手动创建的)图形一样:

我试着用不同的子图试验rankdir,并摆弄rank和constraint属性,但一直在得到这个工作,因为我只用DOT玩弄了几天的失败.
我正在制作一个应用程序来解析来自xml的提要并使用Core Data存储它们.我目前处理的问题是重复的条目.我正在解析的每个feed都包含一个唯一的id,这是我在模型中作为int获得的东西.现在我需要的是告诉Core Data 如果已存在具有相同id的另一个实体,则不要存储该实体.
举个例子,假设我的模型具有以下属性:
Story.id (int) - primary key
Story.title (NSString)
Story.date (NSDate)
Run Code Online (Sandbox Code Playgroud)
实现它的最佳方法是什么?
我的方法是保留数据库中所有可用ID的记录(数组),并在插入任何内容之前,检查它是否存在.这可能适用于我的应用程序的大小,但我觉得这不是正确的方法.
所以我重写了dealloc方法,因为该对象是一个由另一个对象组成的复合对象.
我原来有这种dealloc方法:
-(id) dealloc; // Override to release the Rectangle object’s memory
{
[rect release];
[super dealloc];
return self;
}
Run Code Online (Sandbox Code Playgroud)
看完这本书后,我看到了另一个答案:
{
[rect release];
return [super dealloc];
}
Run Code Online (Sandbox Code Playgroud)
只是想知道两者是否同样有效.
谢谢,
缺口
我希望在sqlite数据库的表中添加一行.
[NSString stringWithFormat:@"INSERT INTO myTable (rowid,myName ) VALUES (NULL, '%@');" , [aInfo myString]];
Run Code Online (Sandbox Code Playgroud)
rowid是自动增量.
插入行后,我希望自动获取由sqlite生成的rowid.
可能吗?
欢迎任何评论
谢谢
大家好.我正在使用Dave DeLong的CHCSVParser来解析csv.我可以在本地解析csv,但我无法加载远程csv文件.今天我一直盯着我的MacBook方式,答案就在我面前.这是我的代码:
NSString *urlStr = [[NSString alloc] initWithFormat:@"http://www.somewhere.com/LunchSpecials.csv"];
NSURL *lunchFileURL = [NSURL URLWithString:urlStr];
NSStringEncoding encoding = 0;
CHCSVParser *p = [[CHCSVParser alloc] initWithContentsOfCSVFile:[lunchFileURL path] usedEncoding:&encoding error:nil];
[p setParserDelegate:self];
[p parse];
[p release];
Run Code Online (Sandbox Code Playgroud)
感谢有人能给我的任何帮助.
此代码返回0个不正确的对象.但是,删除谓词时,获取请求将返回所有对象.
NSError *error = nil;
NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"Person" inManagedObjectContext:[self managedObjectContext]];
NSPredicate * pr = [NSPredicate predicateWithFormat:@"%K beginswith '%@' ",
@"FullName", searchText];
//NSPredicate * pr = [NSPredicate predicateWithFormat:@"PersonID == %@", searchText]; Works fine
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
[request setEntity:entityDescription];
[request setPredicate:pr];
NSArray * arr = [[self managedObjectContext] executeFetchRequest:request error:&error];
Run Code Online (Sandbox Code Playgroud)
FullName属性包含unicode数据(阿拉伯语).
任何帮助表示赞赏.
如何在Objective-C中获取相对日期?
如果我有"今天",我如何找到"昨天","上周","过去两周","一个月前","两个月前"?
我需要在Cocoa中创建一个弹出窗口或下拉菜单,其中包含图像或带有文本的图像作为项目的表示.任何人都可以建议我以编程方式做到这一点吗?
像许多人一样,我对Objective-C和Cocoa编程很感兴趣.我从概念上知道代理是什么,但我不明白如何使用它们或何时使用它们.这是一些示例代码:
#import "AppControler.h"
@implementation AppControler
-(id)init
{
[super init];
NSLog(@"init");
speechSynth = [[NSSpeechSynthesizer alloc] initWithVoice:nil];
//
[speechSynth setDelegate:self];
voiceList = [[speechSynth availableVoices] retain];
return self;
}
Run Code Online (Sandbox Code Playgroud)
我将AppControler设置为speechSynthasizer的委托.这意味着speechSynthasizer告诉了AppControler该怎么做.但我不明白这一行:
[speechSynth setDelegate:self];
objective-c ×5
cocoa ×4
iphone ×4
core-data ×2
csv ×1
dealloc ×1
dot ×1
facebook ×1
graph ×1
graphviz ×1
image ×1
menu ×1
nspredicate ×1
primary-key ×1
sqlite ×1