小编aLF*_*RSi的帖子

如何在UINavigationBar中更改编辑/完成按钮标题

如果为tableview启用了编辑模式,则会显示一个标题为"编辑"的按钮,按下该按钮会将标题更改为完成

我想知道是否有办法将完成按钮标题更改为其他内容?

我已经改变了完成按钮的标题.

我使用的代码是

self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.editButtonItem.title = @"Change";
Run Code Online (Sandbox Code Playgroud)

现在编辑就是变化

如何完成其​​他事情?

iphone xcode objective-c

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

即使有分页,也无法获得我的所有Instagram关注者列表

我正在使用此链接获取我的关注者列表用户名

https://api.instagram.com/v1/users/self/followed-by?access_token=XXXXXX
Run Code Online (Sandbox Code Playgroud)

它返回50个用户,其中包含下一个50的分页URL

问题是在我达到245个用户后,分页网址将停止显示,我确实有超过300个.

当我试图得到另一个用户不是我的其他用户的列表和其超过600粉丝的公共用户时,我设法得到了列表

https://api.instagram.com/v1/users/{user-id}/followed-by?access_token=XXXXXX
Run Code Online (Sandbox Code Playgroud)

所以我说也许我应该更改请求链接并替换self为我的用户ID,因为这是两个请求之间的唯一不同但仍然得到相同的结果,只有245.

https://api.instagram.com/v1/users/{my-user-id}/followed-by?access_token=XXXXXX
Run Code Online (Sandbox Code Playgroud)

那么还有另一种方法来获取所有关注者的用户名吗?或Instagram限制此端点?

提前致谢 :)

UPDATE

我甚至尝试添加&count=-1它并不起作用&count=100,&count=300仍然只显示245个用户

api pagination instagram

5
推荐指数
0
解决办法
3191
查看次数

如何在一个命令中更改所有标签字体

如果我有3个名为total,score和name的标签,我想更改文本的字体,我使用此命令

[total setFont:[UIFont fontWithName:@"Times New Roman" size:22]];
[score setFont:[UIFont fontWithName:@"Times New Roman" size:22]];
[name setFont:[UIFont fontWithName:@"Times New Roman" size:22]];
Run Code Online (Sandbox Code Playgroud)

如果我在一个视图中有超过20个标签,并且所有人都有不同的名称,如总得分名称,该怎么办?

是否有更短的方法将所有字体更改为相同的字体类型?

iphone xcode objective-c ipad

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

UITableViewCell中的字幕对齐

我正在尝试在单元格中构建带有字幕文本的表格视图

问题是,当我尝试将字幕文本的对齐方式设置为右侧时,它不起作用,但它与主文本一起正常工作

这是我的代码

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

    static NSString *CellIdentifier = @"CustomCell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
    }

    [[cell textLabel] setTextAlignment:UITextAlignmentRight];
    [[cell detailTextLabel] setTextAlignment:UITextAlignmentRight];

    cell.textLabel.text = [array objectAtIndex:indexPath.row];
    cell.textLabel.font = [UIFont systemFontOfSize:18];
    cell.detailTextLabel.text = @"test";
    return cell;
}
Run Code Online (Sandbox Code Playgroud)

当我删除字幕代码时,对齐工作正常

任何的想法 ?

cocoa-touch uitableview uilabel

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

UITableView滚动从服务器加载图像时冻结

我正在使用此代码使用自定义单元格在UITableView中加载我的图像

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

static NSString *CellIdentifier = @"CustomCell";

CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil) {

    NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
    for (id currentObject in topLevelObjects) {
        if ([currentObject isKindOfClass:[CustomCell class]]) {
            cell = (CustomCell *) currentObject;
            break;
        }
    }

    NSString *tempString = [arrayThumbs objectAtIndex:indexPath.row];
    NSURL *imageURL = [NSURL URLWithString:tempString];
    NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
    UIImage *image = [UIImage imageWithData:imageData];
    cell.img.image = image;

}

return cell;
}
Run Code Online (Sandbox Code Playgroud)

使用上面的代码,上下滚动没有问题,但是图像没有正确显示,一些图像在表格中重复,例如,如果数组从1到10保存10个图像并且数组是正确的在顺序中,我在表中得到的图像类似于1,2,3,4,3,3,1,10,8,9 …

cocoa-touch objective-c ios

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

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
查看次数