小编Wri*_*sCS的帖子

使用ASP或PHP检查2个目录中是否存在文件

我正在寻找一种方法来比较2个目录,看看两个文件是否存在.我想要做的是删除其中一个目录中的文件(如果两个目录中都存在).

我可以使用ASPPHP.

例:

/devices/1001
/devices/1002
/devices/1003
/devices/1004
/devices/1005

/disabled/1001
/disabled/1002
/disabled/1003
Run Code Online (Sandbox Code Playgroud)

因此,由于1001, 1002, 1003存在/ disabled /,我想从/ devices /中删除它们,只留1004, 1005/ devices /中.

file-io

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

的NSDictionary.如何创建NSDictionary对象

我有这个方法.

[self postRequestWithURL: (NSString *) postArgs:(NSDictionary *) headerArgs: (NSDictionary *) ];
Run Code Online (Sandbox Code Playgroud)

我怎样才能正确调用此方法?

网址是: http://www.google.com/reader/api/0/edit-tag?

帖子args是: "a=user/-/state/com.google/read&ac=edit-tags&s=feed/%@&i=%@&T=%@", entry.link, entry.identifier, tokenString

和标题是:

NSString *authHeader = [NSString stringWithFormat:@"GoogleLogin %@", authString];
[thttpReq addValue:authHeader forHTTPHeaderField:@"Authorization"];

[thttpReq addValue:@"Content-Type" forHTTPHeaderField:@"application/x-www-form-urlencoded"];
Run Code Online (Sandbox Code Playgroud)

sompne可以帮我插入postArgs和HeaderArgs NSDictionary吗?谢谢保罗

iphone objective-c nsdictionary nsmutabledictionary

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

Tableview单元格选择问题

您好我正在使用分组表视图并选择具有蓝色选择样式的Tableview的单元格.

但是当选择单元格并转到下一个视图并再次回到上一个视图时,仍然选择单元格,如果我选择另一个单元格,则显示2个单元格已选中.

在我的代码中查看图像及其下方:

在此输入图像描述

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";
    JobViewTableCell *cell = (JobViewTableCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {

        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
            [[NSBundle mainBundle] loadNibNamed:@"iPadJobViewCell" owner:self options:nil];
            cell = self.JobViewcell;
        }
        else {
        [[NSBundle mainBundle] loadNibNamed:@"JobViewTableCell" owner:self options:nil];
        cell = self.JobViewcell;

        }
    }


    [cell setJobID:[NSString stringWithFormat: @"%@",[(Jobs *)[tableArray objectAtIndex:indexPath.row]JobId]]];
    [cell setJobTitle:[NSString stringWithFormat:@"%@",[(Jobs *)[tableArray objectAtIndex:indexPath.row]Title]]];

    NSString *newDate =[NSString stringWithFormat:@"%@",[(Jobs *)[tableArray objectAtIndex:indexPath.row]Date]];

    NSDateFormatter *dateFormat = …
Run Code Online (Sandbox Code Playgroud)

iphone uitableview

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

滚动时UITableView子视图出现在错误的部分?

在UITableView中,我添加了一个UIView作为子视图,但仅用于第1节.第1节的内容是从plist加载的,plist包含可变内容.如果有足够的行允许滚动,则会发生以下情况:我滚动到底部,然后备份,UITextField随机出现在0部分的单元格中.我不知道为什么会这样!所以我做的是这个(在'cellForRowAtIndexPath'中):

if (indexPath.section == 0) {
    //do stuff
}
else if (indexPath.section == 1) {
    d = [UIView alloc] init];
    [cell.contentView addSubview:d];
}
Run Code Online (Sandbox Code Playgroud)

当我滚动时,这完全搞砸了.子视图出现在第0部分,在那里他们是shoudnt,然后didSelectRowAtIdexPath我重新加载第1部分,然后子视图甚至出现两次(相互之间)......它是一个完整的MESS!拜托,请帮忙.......

objective-c uitableview ios

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

尝试连接终端以识别TextMate的"配对"命令

无法创建链接

创建链接"/ usr/bin/mate"失败,原因如下:不允许操作

当我尝试将终端用法与TextMate链接时,我收到此错误.
我这样做是通过帮助>>终端使用...
我试图在/ usr/bin中创建一个链接.

我认为这个问题与许可问题有关.
我想知道是否有办法解决这个问题,通过直接更改bash文件或其他东西,让终端识别"伙伴"作为命令.

谢谢你的任何建议.

macos bash textmate

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

xCode 4.2错误

我尝试加载另一个视图时收到此错误:

2012-02-21 20:31:38.477 App Demo[1671:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument'
Run Code Online (Sandbox Code Playgroud)

我找不到确切的错误在哪里.

有帮助吗?

更新

NSString *pn1 = player1name.text;
NSString *pn2 = player2name.text;
NSString *pn3 = player3name.text;
NSString *pn4 = player4name.text;
NSString *k = kingdomLevel.text;

Kscores *kscores = [[Kscores alloc] initWithNibName:nil bundle:nil];
kscores.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:kscores animated:YES];


[[kscores player1name] setText:[NSString stringWithString:(NSString *)pn1]];
[[kscores player2name] setText:[NSString stringWithString:(NSString *)pn2]];
[[kscores player3name] setText:[NSString stringWithString:(NSString *)pn3]];
[[kscores player4name] setText:[NSString stringWithString:(NSString *)pn4]];
[[kscores king] setText:[NSString stringWithString:(NSString *)k]]; …
Run Code Online (Sandbox Code Playgroud)

iphone xcode cocoa-touch objective-c ipad

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

C++中使用posix线程的一些奇怪的东西

我在C++中遇到了pthreads的奇怪错误,我尝试运行这段代码:

typedef struct
{
    struct sockaddr_in clienAddr;
    int clientLength;
    string message;
}param;

pthread_t clientThread;

param sentParam ;
sentParam.clienAddr = clientAddress;
sentParam.clientLength= client_info;
sentParam.message=buffString;

cout <<"sentParam: "<<sentParam.message<<endl;
// it prints well.

int i = pthread_create(&clientThread, NULL, handleClientRequestRead,&sentParam );
cout <<"i: "<<i<<endl;
the function which be called

void* handleClientRequestRead(void* params)
{
    // cout<<"params: "<< ;
    string msg = (( param *)(params))->message;
}
Run Code Online (Sandbox Code Playgroud)

当我尝试打印msg时它是空的.任何帮助将不胜感激

c++ linux pthreads

-1
推荐指数
1
解决办法
107
查看次数

这种短路(&&)应该有效,但事情并非如此

当两者都是真的我想要它敬酒......但它看到它们是假的.

if (dateTime > System.currentTimeMillis() && chkBox.isChecked()){
                     Toast.makeText(getBaseContext(), "BEFORE", Toast.LENGTH_SHORT).show();
                     return;
    };
Run Code Online (Sandbox Code Playgroud)

java logic android functional-programming

-2
推荐指数
1
解决办法
114
查看次数