小编Sve*_*eta的帖子


如何在字符串中添加度数符号?

我在写Objective-C.如何在字符串中添加度数符号?我知道它的unicode:00B0和UTF8 : C2 B0.

unicode cocoa objective-c

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

如何在表格中插入行?

我是Objective-c的新手.我有一个包含3行和1个部分的tableView.你能帮我看看如何通过按下按钮(addCity)在表格中添加一些文本行吗?

- (void)viewDidLoad {
    [super viewDidLoad];
    m_bg.image = [UIImage imageNamed:[WeatherAppDelegate isNight]  ? @"SettingsBackNight.png" : @"SettingsBackDay.png" ];
    tableView.layer.cornerRadius = 10;
    m_scrollView.layer.cornerRadius = 10;
    [m_scrollView setContentSize:CGSizeMake(tableView.frame.size.width, tableView.frame.size.height)];
    dataArray = [[NSMutableArray alloc] initWithObjects:@"Moscow", @"London", @"Paris", nil];

}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [dataArray count];
}


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

    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
    } …
Run Code Online (Sandbox Code Playgroud)

row insert objective-c uitableview

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

如何比较时间

如何比较Objective C中的时间?

if (nowTime > 9:00 PM) && (nowTime < 7:00 AM) 
{
  doSomething;
}
Run Code Online (Sandbox Code Playgroud)

time compare objective-c

6
推荐指数
2
解决办法
8425
查看次数

仪器中的红线

我正在使用objective-c编程并在Instruments中测试我的应用程序.我上传了截图.我不明白我的代码上有红线,有什么不对?你能帮助我吗?谢谢.

在此输入图像描述

iphone objective-c instruments ipad ios

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

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

旋转动画

我将箭头旋转了45度.动画结束时,箭头返回其原始状态(0度).我需要箭头不会返回到原始状态,并且在动画结束时它将旋转45度.

CABasicAnimation *fullRotationShort = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
fullRotationShort.fromValue = [NSNumber numberWithFloat:0];
fullRotationShort.toValue = [NSNumber numberWithFloat:M_PI/28*4.7];
fullRotationShort.duration = 1.0f;
fullRotationShort.repeatCount = 1;
[imgViewArrowShort.layer addAnimation:fullRotationShort forKey:nil];
Run Code Online (Sandbox Code Playgroud)

iphone animation objective-c rotation

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

如何检测UILabel中的省略号?

我正在编程Objective C.我有一个UITableViewUILabel的.如何检测省略号UILabel

objective-c detection uilabel ios

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