我在现有项目中添加了一个新目标。一切正常,但是...此警告变为。Mac OS X部署目标“ iphone”中的目标“ 10.6”比SDK“ iOS 4.2”要新iphone有人知道如何禁用它吗?
我获取@min或@max值的当前版本是:
for (NSManagedObject *destination in allSpecifics)
{
[allRates addObject:[destination valueForKey:@"rate"]];
}
NSExpression *arrayExpression = [NSExpression expressionForConstantValue: allRates];
NSArray *argumentArray = [NSArray arrayWithObject: arrayExpression];
NSExpression* expression = [NSExpression expressionForFunction:@"min:" arguments:argumentArray];
id result = [expression expressionValueWithObject: nil context: nil];
NSNumber *rateForAdd = result;
Run Code Online (Sandbox Code Playgroud)
allSpecific是NSManagedObjects的数组.看起来像是一种填充对象数组的好方法(内存和处理时间成本).可能有人可以帮助重构它?
亲爱的大家.我们有2个数组(currentCarriers和带有字符串的companyList.最终解决方案必须是数组,它从第一个数组中排除相同的字符串.贝娄是我的解决方案,但可能有两个for循环不像可可风格.也许有人可以建议一些东西更好?
for (NSString *carrier in currentCarriers) {
for (NSString *company in companyList)
{
if ([company isEqualToString:carrier]) [removedCompanies addObject:company]; }
}
NSMutableArray *companiesForAdd = [NSMutableArray arrayWithArray:companyList];
[companiesForAdd removeObjectsInArray:removedCompanies];
Run Code Online (Sandbox Code Playgroud) 亲爱的社区.我尝试从其他线程中从主AppDelegate中的托管对象上下文中拾取一些数据.
NSError *error = nil;
AppDelegate *appDelegate = [[NSApplication sharedApplication] delegate];
NSFetchRequest *requestCodesList = [[[NSFetchRequest alloc] init] autorelease];
[requestCodesList setEntity:[NSEntityDescription entityForName:@"CodesvsDestinationsList"
inManagedObjectContext:[appDelegate managedObjectContext]]];
[requestCodesList setPredicate:[NSPredicate predicateWithFormat:@"(%K.carrier.name == %@) AND (%K.prefix == %@) AND (code == %@) AND (originalCode == %@)",
destinationTypeRelationShipName,
carrierName,
destinationTypeRelationShipName,
prefix,
[destinationParameters valueForKey:@"code"],
[destinationParameters valueForKey:@"originalCode"]]];
//[destinationParameters valueForKey:@"originalCode"]]];
NSLog(@" Predicate is:%@ START",requestCodesList);
NSArray *codesInLocalSystem = [[appDelegate managedObjectContext] executeFetchRequest:requestCodesList error:&error];
Run Code Online (Sandbox Code Playgroud)
我只是从主MOC读取信息,所以,这不是一个线程安全的麻烦,bcs我不会在那里写任何东西.问题是在某个时候开始.这是我收到的错误:
2010-12-16 12:55:05.162 snow [53293:3a0b] - [NSManagedObject isTemporaryID]:无法识别的选择器发送到实例0x11836db00
*** Call stack at first throw:
(
0 CoreFoundation 0x00007fff84cb47b4 __exceptionPreprocess …
Run Code Online (Sandbox Code Playgroud) 分析是在subj中产生警告.有什么建议吗?
const char *cString = [query UTF8String];
unsigned long long affectedRows;
if (self.sqlPut != NULL) {
mysql_query(self.sqlPut,cString);
affectedRows = mysql_affected_rows(self.sqlPut);
if (affectedRows == 0) NSLog(@"MYSQL: Query: %@ was failed with error:%s\n and error number:%d",query,mysql_error(self.sqlPut),mysql_errno(self.sqlPut));
}
else {
[self mysqlConnect];
if (sqlPut != NULL) {
mysql_query(self.sqlPut,cString);
affectedRows = mysql_affected_rows(self.sqlPut);
if (affectedRows == 0) NSLog(@"MYSQL: Query: %@ was failed with error:%s\n and error number:%d",query,mysql_error(self.sqlPut),mysql_errno(self.sqlPut));
}
}
NSNumber *affectedRowsNumber = [[[NSNumber alloc] initWithUnsignedLongLong:affectedRows] autorelease];
return affectedRowsNumber;
Run Code Online (Sandbox Code Playgroud)