小编bub*_*drc的帖子

POST和PUT请求AFNetworking

我正在尝试拨打服务器.GET调用工作正常并返回正确的json,但是当我尝试执行PUT或POST时,服务器返回错误.

我将服务器设置为接收下一条消息:

method POST
curl -X POST -d "number=NUMBER&name=NAME&lat=32.5713&lon=60.3926"  http://server.com/users/

method PUT
curl -X PUT -d "number=USER&name=NAME6&lat=-34.5552&lon=32.3333"  http://server.com/users/
Run Code Online (Sandbox Code Playgroud)

如何使用这两种方法调用服务器?

rest post put ios afnetworking

6
推荐指数
1
解决办法
8744
查看次数

搜索栏工作正常,但表格不显示结果

我正在尝试为我的iOS 7应用程序实现搜索栏.

表格视图不显示过滤器处于活动状态时的值,但过滤器是正确的.

所以,我得到了所有结果: 在此输入图像描述

然后,我开始过滤数据没有有效的结果:

在此输入图像描述

最后,我使用了一个有效的过滤器,并且日志结果是正确的,但表中没有显示: 在此输入图像描述

我不知道如何找到问题.我的代码:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    if (tableView == self.searchDisplayController.searchResultsTableView) {
        return [self.searchResults count];
    } else {
        return [self.balancesData count];
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath     *)indexPath
{
    static NSString *CellIdentifier = @"balancesCell";
    BalancesTableViewCell *cell = (BalancesTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    // Configure the cell...
    if (cell == nil) {
        cell = [[BalancesTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault     reuseIdentifier:CellIdentifier];
    }

    Balances *balance = nil;
    if (tableView == self.searchDisplayController.searchResultsTableView) { …
Run Code Online (Sandbox Code Playgroud)

iphone uitableview ios searchbar

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

标签 统计

ios ×2

afnetworking ×1

iphone ×1

post ×1

put ×1

rest ×1

searchbar ×1

uitableview ×1