问题列表 - 第10994页

UITableView从NSMutableArray/NSDictionary循环输出数据

我目前正在构建一个iPhone应用程序,它将显示来自名为"故事"的NSMutableArray的数据.数组结构如此(通过NSLog):

    2009-07-20 12:38:30.541 testapp[4797:20b] (
    {
    link = "http://www.testing.com";
    message = "testing";
    username = "test";
},
    {
    link = "http://www.testing2.com";
    message = "testing2";
    username = "test2";
} )
Run Code Online (Sandbox Code Playgroud)

我的cellForRowAtIndexPath目前看起来像这样:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];


}

    for (NSDictionary *story in stories) {
        [cell setTextColor:[UIColor whiteColor]];
        [cell setFont: [UIFont systemFontOfSize:11]];
        cell.text = [NSString stringWithFormat:[story objectForKey:@"message"]];
    }
            return cell; …
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch objective-c uitableview nsarray

0
推荐指数
1
解决办法
9098
查看次数

具有Common.Logging和Autofac的自动工厂?

我想将ILog注入我的类,而不是ILoggerFactoryAdapter,但ILoggerFactoryAdapter需要调用类的名称(想要记录某些东西的类,所以我可以正确分类)所以Autofac可以某种方式识别请求的类ILog并从工厂自动创建ILog?

logging dependency-injection autofac

10
推荐指数
2
解决办法
3193
查看次数

如何创建异步方法

我在C#app中有简单的方法,它从FTP服务器中挑选文件并解析它并将数据存储在DB中.我希望它是异步的,以便用户在App上执行其他操作,一旦完成解析,他必须得到消息"解析完成".

我知道它可以通过异步方法调用实现,但我不知道该怎么做才能有人帮助我吗?

c# delegates asynchronous

51
推荐指数
4
解决办法
9万
查看次数

我怎样才能让PHP在出错时产生回溯?

尝试使用其默认的当前行错误消息来调试PHP是非常糟糕的.如何在生成错误时让PHP生成回溯(堆栈跟踪)?

php debugging error-handling stack-trace backtrace

49
推荐指数
4
解决办法
6万
查看次数

使用int [] []和int [,]之间有什么区别?

来自perl背景,我一直使用定义2D数组int[][].我知道你可以使用,int[,]所以有什么区别?

.net c# multidimensional-array

9
推荐指数
3
解决办法
949
查看次数

在XCode,Cocoa应用程序中找不到的符号

虽然我已经完成了一些Java开发和一些C(++)开发,但我完全不熟悉Apple的Objective C和XCode.

因此,我完全被以下错误消息困扰:

Building target “BatteryApp” of project “BatteryApp” with configuration “Debug” — (1 error)
        cd /Users/soren/Documents/BatteryApp
    setenv MACOSX_DEPLOYMENT_TARGET 10.5
    /Developer/usr/bin/gcc-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/soren/Documents/BatteryApp/build/Debug -F/Users/soren/Documents/BatteryApp/build/Debug -filelist /Users/soren/Documents/BatteryApp/build/BatteryApp.build/Debug/BatteryApp.build/Objects-normal/i386/BatteryApp.LinkFileList -mmacosx-version-min=10.5 -framework Cocoa -o /Users/soren/Documents/BatteryApp/build/Debug/BatteryApp.app/Contents/MacOS/BatteryApp
Undefined symbols:
  "_IOPSCopyPowerSourcesList", referenced from:
      _main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
          "_IOPSCopyPowerSourcesList", referenced from:
              _main in main.o
        ld: symbol(s) not found
        collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

它来自默认的Cocoa应用程序,main.m看起来像这样:

import <Cocoa/Cocoa.h>
import <IOKit/ps/IOPowerSources.h>

int main(int argc, char *argv[])
{
    CFTypeRef …
Run Code Online (Sandbox Code Playgroud)

objective-c

5
推荐指数
1
解决办法
1万
查看次数

LINQ中的多级分组?

我有一个具有以下结构的记录列表:(简化示例!)

class Rate
{
    string Code;
    double InterestFrom;
    double InterestTo;
    double IncomeFrom;
    double IncomeTo;
    double Value;
}
Run Code Online (Sandbox Code Playgroud)

是的,我定义了List <Rate>.我需要将此列表转换为以下简化结构:

class RateList
{
   List<Code> code;
}
class Code
{
    string code;
    List<Interest> interest;
}
class Interest
{
    double InterestFrom;
    double InterestTo;
    List<Income> income;
}
class Income
{
    double IncomeFrom;
    double IncomeTo;
    double Value;
}
Run Code Online (Sandbox Code Playgroud)

我想用一个LINQ查询来做这件事.我可以解决其他解决方案,但挑战是在一个LINQ语句中完成.基本上,顶级组按代码分组.下一个级别是值InterestFrom和InterestTo,最低级别是IncomeFrom,IncomeTo和Value的列表.

那么,LINQ语句会是什么呢?

c# linq

7
推荐指数
1
解决办法
5365
查看次数

等待TcpClient数据可用的最佳方法?

while (TcpClient.Client.Available == 0)
{
    Thread.Sleep(5);
}
Run Code Online (Sandbox Code Playgroud)

有一个更好的方法吗?

.net c# tcpclient

11
推荐指数
1
解决办法
2万
查看次数

在javascript中的array_flip?

是否有任何捷径可以在javascript中完成相当于PHP的array_flip,还是必须通过暴力循环来完成?

它必须用于几十个阵列,所以即使很小的加速也可能会加起来.

javascript arrays

25
推荐指数
3
解决办法
2万
查看次数

如何将当前的powershell管道对象"$ _"作为命令行arg传递?

我正在尝试在一组管道文件上设置所有svn:property:

dir * -include *.cs | Select-String -simplematch -pattern "HeadURL$" | select filename | svn propset svn:keywords "HeadURL Id LastChangedBy LastChangedRevision" $_
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

svn: Try 'svn help' for more info
svn: Explicit target required ('HeadURL Id LastChangedBy LastChangedRevision' interpreted as prop value)
Run Code Online (Sandbox Code Playgroud)

问题是,$ _没有传递给svn propset ...

该怎么办?

svn powershell

4
推荐指数
1
解决办法
1万
查看次数