我怎样才能将NSString的fisrt字母大写,并删除任何重音?
例如,Àlter,Alter,alter应该成为 Alter.
但是,/lter,)lter,:lter应该仍然是相同的,作为第一个字符是不是字母.
我是CSS的亵渎,我对此一无所知.我需要将HTML代码和CSS格式放在iPhone程序的相同字符串对象中.
我有HTML代码和CSS代码,但我不知道如何将它们混合在一起.你可以帮帮我吗?
HTML代码:
<html>
<head>
<link type="text/css" href="./exemple.css" rel="stylesheet" media="all" />
</head>
<body>
<p>
<span class="title">La super bonne</span>
<span class="author">proposée par Jérém</span>
</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
CSS样式:
.title {
color: blue;
text-decoration: bold;
text-size: 1em;
}
.author {
color: gray;
}
Run Code Online (Sandbox Code Playgroud) 我以模态方式呈现ViewController.如何访问父视图控制器?
我的架构是TabBarController => VC1 => VC2 => VC3 => MVC1,我想从MVC1到达VC3.
在VC3中,我有这个代码:
- (void) editAd{
AskPasswordViewController *modalViewController = [[AskPasswordViewController alloc] initWithNibName:@"AskPasswordView" bundle:nil];
NSLog(@"modalparent class=%@", [[modalViewController parentViewController] class]);
[self presentModalViewController:modalViewController animated:YES];
[modalViewController release];
}
Run Code Online (Sandbox Code Playgroud)
我在MVC1中试过这个:
- (void) sendRequest {
NSLog(@"classe : %@",[[self parentViewController] class] );
}
Run Code Online (Sandbox Code Playgroud)
但它返回我的TabBarViewController ...
有没有办法从Objective-C中的代码自动创建UML图?
干杯,尼尔斯
我正在使用此代码
if (managedObject == nil) {
NSLog(@"foooo");
}
Run Code Online (Sandbox Code Playgroud)
测试创建的managedObject是否为nil.但我永远不能打印这个Fooooo.你知道我做错了什么吗?
将子视图添加到UITableViewCell时遇到问题.当桌面尺寸低于iPhone尺寸时,它正在工作.
但是当尺寸越来越大时,我在滚动时会产生一些像这样的可怕效果:

应该是这样的:
然后我认为它来自细胞再利用.以下是我的代码示例:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *kCellIdentifier = @"UITableViewCellStyleSubtitle";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier];
if (cell == nil) {
//construct the cell
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:kCellIdentifier] autorelease];
//clear the previuous content
NSLog(@"Il y a %d subviews", [[[cell contentView] subviews] count]);
//[[[cell contentView] subviews] makeObjectsPerformSelector: @selector(removeFromSuperview)];
NSLog(@"Il y a %d subviews", [[[cell contentView] subviews] count]);
[[cell textLabel] setBackgroundColor:[UIColor clearColor]];
[cell setSelectionStyle:UITableViewCellEditingStyleNone];
}
switch (indexPath.row) {
case 0:
[cell addSubview:titleEvent];
break;
case 1: …Run Code Online (Sandbox Code Playgroud) NSSearchPathDirectory
这些常量指定各种目录的位置.
enum {
NSApplicationDirectory = 1,
NSDemoApplicationDirectory,
NSDeveloperApplicationDirectory,
NSAdminApplicationDirectory,
NSLibraryDirectory,
NSDeveloperDirectory,
NSUserDirectory,
NSDocumentationDirectory,
NSDocumentDirectory,
NSCoreServiceDirectory,
NSAutosavedInformationDirectory = 11,
NSDesktopDirectory = 12,
NSCachesDirectory = 13,
NSApplicationSupportDirectory = 14,
NSDownloadsDirectory = 15,
NSInputMethodsDirectory = 16,
NSMoviesDirectory = 17,
NSMusicDirectory = 18,
NSPicturesDirectory = 19,
NSPrinterDescriptionDirectory = 20,
NSSharedPublicDirectory = 21,
NSPreferencePanesDirectory = 22,
NSItemReplacementDirectory = 99,
NSAllApplicationsDirectory = 100,
NSAllLibrariesDirectory = 101
};
typedef NSUInteger NSSearchPathDirectory;
Run Code Online (Sandbox Code Playgroud)
在那些路径目录中,我知道NSCachesDirectory和NSDocumentDirectory在iOS中可用.你知道其他人是否也是吗?
目前我正在NSCachesDirectory中下载图像,我使用[UIImage imageNamed:]在屏幕上打印图片.但我正在寻找一个更明确的文件夹来存储我的图像.
谢谢,
如何解析mailto请求?
'mailto:someone@example.com?cc=someone_else@example.com&subject=This%20is%20the%20subject&body=This%20is%20the%20body'
Run Code Online (Sandbox Code Playgroud)
从这个NSURL,我想提取收件人,主题和身体.我应该怎么做 ?
谢谢
我想要一些精确的dequeueReusableCellWithIdentifier:kCellIdentifier.如果我理解得很好,下面的NSLOG应该打印一次.但事实并非如此.那么dequeueReusableCell有什么意义呢?它只对定制单元有效吗?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *kCellIdentifier = @"UITableViewCellStyleSubtitle3";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier];
if (cell == nil)
{
NSLog(@"creation of the cell");
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:kCellIdentifier] autorelease];
}
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text = [[self.table objectAtIndex:indexPath.row] objectForKey:kTitleKey];
[cell setBackgroundColor:[UIColor colorWithWhite:1 alpha:0.6]];
return cell;
}
Run Code Online (Sandbox Code Playgroud) ios ×9
iphone ×9
objective-c ×2
uitableview ×2
css ×1
devicetoken ×1
directory ×1
html ×1
null ×1
parsing ×1
path ×1
testing ×1
uml ×1
uppercase ×1