我在UITextView中使用arial字体,但我想更改为Myriad但它没有改变
textView.font=[UIFont fontWithName:@"Myriad" size:20];
Run Code Online (Sandbox Code Playgroud) 当我点击任何单元格文本它变成蓝色,当我再次回来时它仍然保持蓝色,直到我点击另一个单元格如何解决这个问题我使用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) 我是使用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)