我的UITableViewController或NSFetchedResultsController有点问题.我不确定问题是什么,但我猜它是UITableViewController.
正如我所说的,我使用NSFetchedResultsController将我的数据填充到UITableViewController中.数据按日期排序,并按日期显示在各个部分,例如2010年5月/ 2010年6月/等.这显示为节标题.
现在,当我添加新数据时,它会自动使用当前日期作为默认值,但是如果我想使用日期,那当前不在部分列表中,例如2010年4月(目前列表中的5月和6月),那么这是没有正确显示.只有当我退出应用程序并再次启动它时,它才会显示新的部分标题,一切都很好.
所以我需要能够刷新我的列表或更新它.只需将其添加到上下文并更改它似乎不会更新它.
同样,我不知道我需要更新什么,如果它是我的NSFetchedResultsController对象或UITableViewController.
更新#1:
我只想到这个方法有一个例外:
- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller
{
// The fetch controller has sent all current change notifications, so tell the table view to process all updates.
[self.tableView endUpdates];
}
Run Code Online (Sandbox Code Playgroud)
这是我移动数据的地方:
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath
{
UITableView *tableView = self.tableView;
switch(type)
{
case NSFetchedResultsChangeInsert:
[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];
break;
case NSFetchedResultsChangeDelete:
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
break;
case NSFetchedResultsChangeUpdate:
// [self configureCell:[tableView cellForRowAtIndexPath:indexPath] atIndexPath:indexPath];
break;
case NSFetchedResultsChangeMove:
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
// …Run Code Online (Sandbox Code Playgroud) 在VB.NET中,如何将以下字符串转换为某种键/值类型,如Hashtable,Dictionary等?
"Name=Fred;Birthday=19-June-1906;ID=12345"
Run Code Online (Sandbox Code Playgroud)
我想提取生日或ID,而不必将字符串拆分为数组.
编辑:如果字符串的格式稍后更改,我宁愿不将字符串拆分为数组.我无法控制字符串.如果有人切换订单或添加另一个元素怎么办?
我试图通过标准偏差消除SQL Server 2008中的异常值.我想只在特定列中包含值的记录在该列平均值的+/- 1标准差内.
我怎么能做到这一点?
如何在Django模板中打印出"{{text}}"?如果我将其键入Django html模板,它将被解释为变量文本.我想要实际的文字:
{{text}}
要出现在html输出中.
我需要在Visual Studio 2010中为WinForms应用程序编写一个帮助文件.理想情况下,我想使用与Visual Studio集成的工具,而不是一个完全独立的工具.
过去我曾经使用HTML Help Workshop,但这很古老,我记得它使用起来有点时髦.我也知道Visual Studio 2005 SDK中内置了一个工具,但我需要2010年的东西.
是否有一些数学"最佳"基础可以加速因子计算?
背景:为了好玩,我正在实施我自己的bignum库.( - :这是我的第一个错误吗?:-).我正在通过打印n阶乘(n!)的精确值(十进制)来试验内部表示和回归测试中使用的各种基数.
我的bignum库表示整数并进行乘法的方式,时间与内部表示n!中"1"位的总数成正比.在我的内部表示中使用基数2,4,8,16,2 ^ 8,2 ^ 30等都给出了与任何特定数字完全相同的"1"位总数.
除非我做了一些错误,任何给定的阶乘(N!)在基地18代表具有比在基地10或或基地16或19基地等等(原则)表示相同的值较少的"1"位,使用基础18会使我的bignum库比使用base 10或某些二进制2 ^ w base或base 19运行得更快.我认为这与n这个事实有关!或者是短或具有更多的"尾随零"或两者时在基部18比底座10打印出来,或或基座16或基座19有一些其他,将工作比基部18甚至更好的基础?换句话说,是否存在代表n的基数!比基数18更少的"1"位?
这不是"bignum库和素性测试算法的便利基础是什么?" 因为我怀疑"的最佳基地与被称为是大阶乘整数,有很多的2和3个因素的工作"比"最佳基地不同的与没有任何小的因素,并可能整数工作主要".( - :加快因子计算 - 可能是以其他类型的计算为代价 - 我的第二个错误?:-)
编辑:例如:
(decimal) 16! ==
(decimal ) == 20,922,789,888,000 // uses decimal 14 "1" bits
(dozenal ) == 2,41A,B88,000,000 // uses decimal 10 "1" bits
(hexadecimal) == 130,777,758,000 // uses decimal 18 "1" bits
(octadecimal) == 5F,8B5,024,000 // uses decimal 14 "1" bits
Run Code Online (Sandbox Code Playgroud)
(我或多或少在右边存储数字,没有逗号,加上一些元数据开销).(虽然有人可能认为"当你增加基地将使用更少的'1’比特来表示给定数量"或""如果增加基体,将使用较少的非零数字来表示给定数量",上述示例显示并非总是如此.)
我将每个数字存储为一个小整数("int"或"long int"或"byte").有没有其他合理的方法来存储数字?我很确定我的计算机将这些整数存储为二进制 - 每个"1","2","4","8"和"G"数字使用一个"1"位; 每个"3","5","6","9"和"A"数字使用两个"1"位; 每个"7"和"B"数字使用三个"1"位; 每个"F"数字使用四个"1"位等.
该值(16!)的十进制和十八进制表示都需要14"1"位.所以我在之前的计算中犯了一个错误:对于每个n,代表n!在十进制中,并不总是比在十进制中表示相同的值具有更少的"1"位.但问题仍然存在:是否还有一些其他"最佳"基础需要最少1位的数据才能存储大型因子?
有人问:"你如何存储这些数字?" 嗯,这正是我的问题 - 存储n形式数字的最佳方法是什么!?我 …
我很好奇SQL Server连接字符串中的令牌"Trusted_Connection"和"Integrated Security"之间有什么区别(我相信其他数据库/驱动程序不支持这些).我明白他们是等同的.
我是Objective C的新手,在尝试导入我定义的类时遇到以下错误
Building target “MusicCube” of project “MusicCube” with configuration “Debug” — (1 error)
cd /Users/varsha_vijay/Downloads/MusicCube
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Xcode3.1.4/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Xcode3.1.4/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Xcode3.1.4/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Xcode3.1.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk -L/Users/varsha_vijay/Downloads/MusicCube/build/Debug-iphonesimulator -F/Users/varsha_vijay/Downloads/MusicCube/build/Debug-iphonesimulator -filelist /Users/varsha_vijay/Downloads/MusicCube/build/MusicCube.build/Debug-iphonesimulator/MusicCube.build/Objects-normal/i386/MusicCube.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AudioToolbox -framework CoreGraphics -framework OpenAL -o /Users/varsha_vijay/Downloads/MusicCube/build/Debug-iphonesimulator/MusicCube.app/MusicCube
ld: duplicate symbol _num_flight_vertices in /Users/varsha_vijay/Downloads/MusicCube/build/MusicCube.build/Debug-iphonesimulator/MusicCube.build/Objects-normal/i386/Flight.o and /Users/varsha_vijay/Downloads/MusicCube/build/MusicCube.build/Debug-iphonesimulator/MusicCube.build/Objects-normal/i386/EAGLView.o
collect2: ld returned 1 exit status
ld: duplicate symbol _num_flight_vertices in /Users/varsha_vijay/Downloads/MusicCube/build/MusicCube.build/Debug-iphonesimulator/MusicCube.build/Objects-normal/i386/Flight.o and /Users/varsha_vijay/Downloads/MusicCube/build/MusicCube.build/Debug-iphonesimulator/MusicCube.build/Objects-normal/i386/EAGLView.o
collect2: ld returned 1 exit status
Build failed (1 error) … 最近我正在调试一个项目,调试器(GDB 7.1)突然崩溃,因为在尝试打印图形结构时无休止的递归.起初我甚至无法想象调试器可能会崩溃(稳定版本),但它有.所以这对我来说真的很有意思,你曾经撞毁过一个调试器吗?
sql-server ×2
biginteger ×1
bignum ×1
c ×1
c++ ×1
chm ×1
debugging ×1
django ×1
duplicates ×1
factorial ×1
gwt ×1
helpfile ×1
integer ×1
iphone ×1
linker ×1
objective-c ×1
panel ×1
sql ×1
statistics ×1
symbols ×1
uitableview ×1
vb.net ×1
winforms ×1