我是iphone开发的新手.我想在标签中包装文本.我想结束标签中的特定位置.谢谢.
我是iphone开发的新手.我在标题标签中显示了文本.现在我想将文本对齐到中心.我使用以下代码
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView* customView = [[UIView alloc] initWithFrame:CGRectMake(10.0, 0.0,300.0,44.0)];
UILabel * headerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel.backgroundColor = [UIColor brownColor];
headerLabel.textColor = [UIColor whiteColor];
headerLabel.highlightedTextColor = [UIColor whiteColor];
headerLabel.font = [UIFont boldSystemFontOfSize:15];
headerLabel.frame = CGRectMake(0.0, 0.0, 500.0, 22.0);
headerLabel.text = @"Hello"; //
[customView addSubview:headerLabel];
return customView;
}
Run Code Online (Sandbox Code Playgroud)
"你好"应该显示在标题标签的中心.请帮帮我.谢谢.
我是iphone开发的新手.我正在研究iphone中的录音.我已经从Apple下载了"speak here"示例程序.我想确定我在iphone中录制的语音频率.请指导我.请指导我.请帮助我.谢谢.
我是iphone开发的新手.我使用下面的代码将值添加到plist但是在执行代码后检查plist时我没有看到plist中保存的任何值.我哪里出错了?请帮帮我.我创建的plist是在资源文件夹中.谢谢.
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *finalPath = [path stringByAppendingPathComponent:@"regvalue.plist"];
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:finalPath];
[plistDict setValue:@"hello" forKey:@"choice"];
[plistDict writeToFile:finalPath atomically: YES];
Run Code Online (Sandbox Code Playgroud)
用于检索值
NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *finalPath = [path stringByAppendingPathComponent:@"regvalue.plist"];
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:finalPath];
NSString *value;
value = [plistDict objectForKey:@"choice"];
NSLog(@"the value is %@",value);
Run Code Online (Sandbox Code Playgroud)
它只给出null值.请帮帮我.谢谢.
我是iphone开发的新手.我想添加RegexKitLite框架.我已经下载了源文件,但我无法在我的项目中添加框架.请帮帮我.谢谢.
我想比较一个字符串与多个字符串.例如
if([var isEqualToString:@"Box"]||[var isEqualToString:@"Ball"]|[varisEqualToString:@"Bat"])
{
some function
}else{
some function
}
Run Code Online (Sandbox Code Playgroud)
在我的情况下,我必须与15字符串进行比较,所以我必须检查15次.是否有任何其他更好的方法来比较它.是否有任何小的简单代码将实现我的逻辑.
我想在Twitter上发布文本作为超链接.我可以将其发布为简单的短信.我使用过Twitter + OAuth.i已经使用过
[_engine sendUpdate:@"My twitter update"];
Run Code Online (Sandbox Code Playgroud)
发布我的内容的方法.如何发布作为超链接,所以点击文本打开一个链接.任何想法?谢谢.
我正在使用sqlite进行数据操作.
我如何在sqlite中插入日期时间值
我在我的应用程序中实现了以下代码.
有用,
DateFormat formatter = new SimpleDateFormat("dd MMM yyyy hh:mm:ss");
String temp=property.getFirstChild().getNodeValue();
Date s=formatter.parse(temp.substring(5, temp.length()-5));
String pubdate= formatter.format(s);
Run Code Online (Sandbox Code Playgroud)
但我不能按日期排序哭或非常伤心哭或非常伤心哭或非常伤心哭或非常伤心哭或非常伤心哭或非常伤心
帮助帮助理念创意
我是iphone开发的新手.我最近有一个可变数组,其中诸如标题,日期,网址和摘要等值被存储为"密钥对象".密钥是myurl,mudate,mytitle,mysummary.我想要排序参考日期的可变数组并根据那些打印所有值.我怎么能实现这一点?请帮帮我.谢谢.
[item setObject:currentTitle forKey:@"title"];
[item setObject:currentLink forKey:@"link"];
[item setObject:currentSummary forKey:@"description"];
[item setObject:currentDate forKey:@"pubDate"];//
[item setObject:currentImage forKey:@"imagePath"];
[recent addObject:[item copy]];
Run Code Online (Sandbox Code Playgroud)
所有都是xml解析的内容.
我在for循环中创建了一个数组,但我无法释放它.它显示内存泄漏.这是我的代码:
for(int i = 0; i < [magArr count]; i++)
{
Magazine *magObj = [magArr objectAtIndex:i];
NSMutableArray *myArray = [data readEditions:[magObj.magazineID intValue]:0];//returns a array
}
[myArray release]; // memory leaks (retain count to -1)
Run Code Online (Sandbox Code Playgroud)
如果我也使用自动释放,它显示内存泄漏.如何解决这个漏洞?
我想从文件名中删除特殊字符.请找到以下代码.我有删除的问题.从文件名,我的代码也删除了.in扩展名.
Ex filename = atf.bac.xlsx
Expected result: atfbac.xlsx
Current Behavior:atfbacxlsx
NSCharacterSet *doNotWant = [NSCharacterSet characterSetWithCharactersInString:@".#%;:?,/|\[]{}@$%^*"];
fileName = [[fileName componentsSeparatedByCharactersInSet: doNotWant] componentsJoinedByString: @""];
Run Code Online (Sandbox Code Playgroud)