我一直在使用Core Data创建一个iPhone App.
首先,使用NSFetchedResultsController和UISearchDisplayController一起获取结果是否有意义?你会推荐别的吗?
我一直在尝试很长时间组合NSFetchedResultController和UISearchDisplayController.我一直在考虑在(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption方法中将NSPredicate设置为UIViewController 的NSFetchedResultController .但这并不是那么好用.
那么,您知道如何为我的问题实施解决方案吗?非常感谢您发布答案或指向优秀教程的链接.
编辑
这是我的代码.UISearchDisplayDelegate方法调用(void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope应在NSFetchedResultController中设置谓词的方法.我还添加了NSFetchedResultController的代码.
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
[self filterContentForSearchText:searchString scope:
[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];
// Return YES to cause the search result table view to be reloaded.
return YES;
}
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption
{
[self filterContentForSearchText:[self.searchDisplayController.searchBar text] scope:
[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:searchOption]];
// Return YES to cause the search result table view to be reloaded.
return YES;
}
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
NSString *query …Run Code Online (Sandbox Code Playgroud) iphone core-data uisearchdisplaycontroller nsfetchedresultscontroller
当我在a4j:commandButton上包含'disabled'属性时,不执行按钮的操作.取消"禁用"属性会使其正常工作.我没有做任何特殊验证(我知道)并且没有看到任何验证错误消息.
这是我的页面的一部分:
<t:dataTable id="myTable"
var="region"
value="#{MyPageBackingBean.regions}"
width="100%">
...
<a4j:commandButton value="Update"
action="#{region.doUpdate}"
oncomplete="alert('done');"
disabled="#{!empty region && region.messageEmpty}"
immediate="true"/>
...
</t:dataTable>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?谢谢!
编辑:
我尝试在t:dataTable上设置preserveDataModel ="true"无效.
我还做了一个测试有一个a4j:commandButton和没有数据表的文本框,但仍然没有触发支持bean操作:
<h:form>
<a4j:region>
<a4j:outputPanel id="testregion">
<h:messages id="messages"/>
<a4j:status>
<f:facet name="start">
<h:graphicImage value="/images/progress_indicator.gif"/>
</f:facet>
</a4j:status>
<h:inputTextarea
rows="5"
value="#{MyPageBackingBean.myValue}"
style="width:100%; border: 1px solid #99CCFF;">
<a4j:support event="onkeyup"
reRender="testregion"
eventsQueue="messageModificationQueue"
ignoreDupResponses="true"
requestDelay="500"/>
</h:inputTextarea>
<a4j:commandButton id="doDelete"
value="Delete"
action="#{MyPageBackingBean.dummy}"
reRender="testregion"
disabled="#{empty MyPageBackingBean.myValue}"/>
<h:outputText value="#{MyPageBackingBean.myValue}"/>
</a4j:outputPanel>
</a4j:region>
</h:form>
Run Code Online (Sandbox Code Playgroud)
以下是用于测试的新支持bean代码:
private String m_myValue = null;
public String getMyValue()
{
return m_myValue;
}
public void setMyValue(String …Run Code Online (Sandbox Code Playgroud) 我有一些非常大的分隔数据文件,我想只处理R中的某些列而不花时间和内存来创建data.frame整个文件.
我所知道的唯一选择是read.table,当我只想要几列或者scan看起来我想要的水平太低时非常浪费.
有没有更好的选择,无论是使用纯R还是调用其他shell脚本来进行列提取,然后在其输出上使用scan或read.table?(这导致了如何调用shell脚本并在R中捕获其输出的问题).
我在那里搜索,没有找到任何类似的话题,所以我发布了一个新问题.
我正在使用现有数据库上的Hibernate.我们不允许更改表结构和数据.应用程序正在从数据库中读取数据,并根据某些逻辑迁移到另一个数据存储区.
现在问题是关于复合PK映射.例如
表A具有复合PK.
Table A
--------
a1 (pk)
a2 (pk)
a3 (pk)
a4 (pk)
foo
bar
========
Run Code Online (Sandbox Code Playgroud)
表B也具有复合PK,并且该复合PK的一部分是A的PK,这里也用作FK.
Table B
--------
a1 (fk,pk)
a2 (fk,pk)
a3 (fk,pk)
a4 (fk,pk)
b1 (pk)
b2 (pk)
b3 (pk)
foo
bar
========
Run Code Online (Sandbox Code Playgroud)
我尝试了几种方法,但没有一种方法可行.谁能告诉一个有效的Hibernate映射解决方案?注释风格更好.
当用户在其中输入错误的值时,我需要在单元格上方(或下方:)显示工具提示(请参见下图).我有一个工具提示,但我需要一个Point来显示它在正确的位置,所以我想获得一个单元格位置.你知道怎么做吗?
但是,如果你有一个更好的解决方案来实现这种行为,我对所有命题持开放态度(特别是因为工具提示没有与cell/Jtable/Panel绑定,如果我移动/关闭/最小化我的窗口工具提示显示在同一位置)
替代文字http://img246.imageshack.us/img246/6756/errorpopup.png
谢谢,Damien
我有两个类型ICollection<MyType>称为c1和的集合c2.我想找到的一组是在项目c2中没有的c1,在争取平等的启发是Id物业MyType.
在C#(3.0)中执行此操作的最快方法是什么?
我正在使用iTextSharp(.NET 2.0 Vista)。iTextSharp版本为4.1.2.0
PdfReader reader = new PdfReader(pdfFile);
Run Code Online (Sandbox Code Playgroud)
导致库引发异常,提示“找不到预告片”,
该文件存在并且可以在Adobe中查看,没问题吗?
我想继承pom.xmlMaven 2.2.1中子项目中(父)的依赖关系; 即使用项目继承.看来有必要默认的包装类型的变化jar,以pom在这种情况下.
但是,Maven2文档是否表明包装类型pom对于项目聚合是必要的,即使用子模块而不是项目继承的多模块项目?
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>example-parent</artifactId>
<version>1</version>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>
</project>
<project>
<parent>
<groupId>example</groupId>
<artifactId>example-parent</artifactId>
<version>1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>example</groupId>
<artifactId>example-child</artifactId>
</project>
Run Code Online (Sandbox Code Playgroud)
但是如果你mvn clean用上面的配置调用Maven(例如),你会收到一个错误:
Project ID: example:example-child
Reason: Parent: example:example-parent:jar:1
of project: example:example-child has wrong packaging: jar.
Must be 'pom'. for project example:example-child
Run Code Online (Sandbox Code Playgroud)
另一方面,使用以下条目:
<project>
...
<packaging>pom</packaging>
...
</project>
Run Code Online (Sandbox Code Playgroud)
在父级中pom.xml,Maven可以在没有任何错误的情况下执行.
Maven的这种行为是否正确?
它看起来不像C++/CLI中的System命名空间中对Action和Func委托的支持.至少不适用于多个通用参数,例如:
System::Action<int, int>^ action = nullptr;
System::Func<int, int>^ func = nullptr;
Run Code Online (Sandbox Code Playgroud)
两者都会导致错误,例如:
error C2977: 'System::Action' : too many generic arguments
error C2955: 'System::Action' : use of class generic requires generic argument list
Run Code Online (Sandbox Code Playgroud)
只有单个参数Action有效:
System::Action<int>^ action = nullptr;
Run Code Online (Sandbox Code Playgroud)
任何人,知道为什么或缺少什么来使这项工作.我正在使用Visual Studio 2008,该项目有目标框架3.5.
我最初发布这个问题寻找使用python的答案,得到了一些很好的帮助,但仍然无法找到解决方案.我有一个在OS X 10.5客户端计算机上运行的脚本,用于捕获Internet浏览历史记录(在美国公立学校需要作为我的系统管理员职责的一部分).Firefox 3.x将历史存储在sqlite数据库中,我已经弄清楚如何使用python/sqlite3获取该信息.Firefox 3.x使用传统的unixtimestamp标记访问并且不难转换... Chrome还将浏览器历史记录存储在sqlite数据库中,但其时间戳格式为自1601年1月以来的微秒数.我想要使用python来解决这个问题,但据我所知,sqlite3模块不支持该UTC格式.还有其他工具可以将Chrome时间戳转换为人类可读的格式吗?
.net ×3
java ×3
c# ×2
.net-3.5 ×1
ajax4jsf ×1
c++-cli ×1
complement ×1
core-data ×1
datetime ×1
delegates ×1
delimited ×1
generics ×1
hibernate ×1
inheritance ×1
iphone ×1
itextsharp ×1
java-ee ×1
jsf ×1
jtable ×1
linq ×1
macos ×1
maven-2 ×1
packaging ×1
pom.xml ×1
python ×1
r ×1
read.table ×1
richfaces ×1
swing ×1
tooltip ×1