小编ali*_*ali的帖子

UITextView字体不变

我在UITextView中使用arial字体,但我想更改为Myriad但它没有改变

    textView.font=[UIFont fontWithName:@"Myriad" size:20];
Run Code Online (Sandbox Code Playgroud)

iphone objective-c

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

UITableView单元格颜色不会消失

当我点击任何单元格文本它变成蓝色,当我再次回来时它仍然保持蓝色,直到我点击另一个单元格如何解决这个问题我使用UITableView与详细文本标签.

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle  reuseIdentifier:CellIdentifier] autorelease];
    UIImageView* img = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"cell1.png"]];
    [cell setBackgroundView:img];
    [img release];
}
Run Code Online (Sandbox Code Playgroud)

iphone objective-c

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

如何从iphone应用程序中的JSON数据中获取整数值

我是使用JSON中的以下日期的parisng数据

[
 {
     "categoryId": 202,
     "name": "Sport"
 },
 {
     "categoryId": 320,
     "name": "Fritid"
 },
 {
     "categoryId": 350,
     "name": "Kultur"
 },
 {
     "categoryId": 4920,
     "name": "Diverse"
 },
 {
     "categoryId": 4774,
     "name": "Samfunn"
 } ]
Run Code Online (Sandbox Code Playgroud)

使用Follwing代码

SBJsonParser *parser = [[SBJsonParser alloc] init];

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.krsconnect.no/community/api.html?method=categories&appid=620&mainonly=true"]];
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
NSDictionary *object = [parser objectWithString:json_string error:nil];
//appDelegate.books = [[NSMutableArray alloc] initWithCapacity:0];

appDelegate.books = [[NSMutableArray alloc] init];

NSArray *results = [parser …
Run Code Online (Sandbox Code Playgroud)

iphone json objective-c

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

标签 统计

iphone ×3

objective-c ×3

json ×1