小编Nie*_*gen的帖子

NSString中的大写首字母

我怎样才能将NSString的fisrt字母大写,并删除任何重音?

例如,Àlter,Alter,alter应该成为 Alter.

但是,/lter,)lter,:lter应该仍然是相同的,作为第一个字符是不是字母.

iphone ios uppercase

38
推荐指数
3
解决办法
5万
查看次数

如何将CSS和HTML代码放在同一个文件中?

我是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)

html css

30
推荐指数
2
解决办法
12万
查看次数

访问模态视图控制器父级

我以模态方式呈现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 ...

iphone ios

26
推荐指数
4
解决办法
3万
查看次数

设备令牌是否与设备ID一样唯一?

如果我们重置iPhone,设备ID保持不变.设备令牌是否相同?

iphone devicetoken ios

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

如何从Objective-C代码自动生成UML图?

有没有办法从Objective-C中的代码自动创建UML图?

干杯,尼尔斯

iphone uml objective-c ios

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

测试创建的对象是否为零

我正在使用此代码

    if (managedObject == nil) {
        NSLog(@"foooo");
    }
Run Code Online (Sandbox Code Playgroud)

测试创建的managedObject是否为nil.但我永远不能打印这个Fooooo.你知道我做错了什么吗?

iphone testing null objective-c ios

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

将子视图添加到UITableViewCell

将子视图添加到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)

iphone uitableview ios

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

可在iOS中使用的路径目录

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:]在屏幕上打印图片.但我正在寻找一个更明确的文件夹来存储我的图像.

谢谢,

iphone directory path ios

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

解析NSURL mailto

如何解析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,我想提取收件人,主题和身体.我应该怎么做 ?

谢谢

iphone parsing ios

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

dequeueReusableCellWithIdentifier如何工作?

我想要一些精确的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)

iphone uitableview ios

5
推荐指数
2
解决办法
2904
查看次数

标签 统计

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