小编The*_*Dev的帖子

textField在UITableView中出现两次

我有我的ageTextField财产TableViewController.我将它添加到第一部分单元格的子视图但我不知道为什么它在另一部分(#3)中向下滚动时显示...

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier];
    }
    // Configure the cell...
    switch (indexPath.section){
        case 0:
        {
            [cell addSubview:self.ageTextField];
        }
        break;
        case 1:
        {
            cell.textLabel.text = [screeningArray objectAtIndex:indexPath.row];
            if (indexPath.row == 0)     //no choice
                cell.accessoryType = self.doneScreening ? UITableViewCellAccessoryNone:UITableViewCellAccessoryCheckmark;
            else                        //yes choice
                cell.accessoryType = self.doneScreening ? UITableViewCellAccessoryCheckmark:UITableViewCellAccessoryNone;
        }
        break;
        case 2:
        {
            cell.textLabel.text = …
Run Code Online (Sandbox Code Playgroud)

uitableview uitextfield

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

如何在iphone中设置NSDictionary中的数组值和键?

这里我使用NSMutableArray存储日期,然后我尝试设置键并在字典中分配ArrayValue但应用程序崩溃了,请帮助我

提前致谢

 Here i tried the code for your reference:

  [DateArray addObject:dateString]; //NSMutablArray 
  NSMutableDictionary *myDictionary =[[NSMutableDictionary alloc]init];         
  [myDictionary setObject:DateArray forKey:@"Date"]; //put array value and set key in NSDictionary.
Run Code Online (Sandbox Code Playgroud)

iphone object nsdictionary nsmutablearray ios

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

访问相机视图并在ios5中捕获图像使用哪个框架?

之前使用ios 5 AVFoundationFramework但它不能与ios5 storyboard应用程序提供链接错误,即使我添加框架请帮助我.

下面给出的方法给出了前3或4个错误.

  - (id) init
{
    self = [super init];
    if (self != nil) {

        void (^deviceConnectedBlock)(NSNotification *) = ^(NSNotification *notification) {
            AVCaptureDevice *device = [notification object];

            BOOL sessionHasDeviceWithMatchingMediaType = NO;
            NSString *deviceMediaType = nil;
            if ([device hasMediaType:AVMediaTypeAudio])
                deviceMediaType = AVMediaTypeAudio;
            else if ([device hasMediaType:AVMediaTypeVideo])
                deviceMediaType = AVMediaTypeVideo;

            if (deviceMediaType != nil) {
                for (AVCaptureDeviceInput *input in [session inputs])
                {
                    if ([[input device] hasMediaType:deviceMediaType]) {
                        sessionHasDeviceWithMatchingMediaType = YES;
                        break;
                    }
                }

                if (!sessionHasDeviceWithMatchingMediaType) {
                    NSError *error;
                    AVCaptureDeviceInput …
Run Code Online (Sandbox Code Playgroud)

iphone avfoundation ios5

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

重载视图后如何保存tableView单元格的复选标记使用NSUserDefaults?

我是ios开发的新手,我在一个单元格中使用了checkmark UITableView.

我想在NSUserDefaults数据库中存储已检查的单元格,当我重新加载应用程序时,将显示之前选中的已检查单元格,我尝试不同的方式,但仍未能实现它.

有人可以帮帮我吗?我将非常感激.对不起,我的英语不好.

我的代码如下:

#import "FirstRowSubview.h"

@interface FirstRowSubview ()

@end

@implementation FirstRowSubview

@synthesize array = _array;
@synthesize lastIndexPath = _lastIndexPath;


- (void)viewDidLoad
{
    [super viewDidLoad];
    NSMutableArray *list = [[NSMutableArray alloc] initWithObjects:@"ffgfgh", @"564654", @"56548", @"fgmjfgmf", @"ggkdj", nil];
    self.array = list;
    [list release];

}

- (void)viewDidUnload
{
    [super viewDidUnload];
    self.array = nil;
}


#pragma mark -
#pragma mark - TableView Datasource Methods

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ …
Run Code Online (Sandbox Code Playgroud)

uitableview checkmark ios

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

XCode如何评估内部带有X表达式的String公式

我想把一个字符串公式计算到浮点数,但我找不到解决方案.这是一个例子.我需要以这种方式计算大约200个公式.

- NSString *Formula;
- Float  *Result;
- Float *x

- x = 12;
- Formula = @"12.845*x+(-0.505940)";
Run Code Online (Sandbox Code Playgroud)

结果=评估/计算(公式);

然后我将使用Result作为公式的结果. - >结果= @"12.845*x +( - 0.505940)";

objective-c

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

iOS:如何在人脸识别中找到面部的程度?

我可以使用苹果的应用程序squareCam进行人脸识别.每件事情都很好,但现在我想识别倾斜位置的脸,意味着当脸部倾斜30至35度时,我想识别它们并根据程度想要倾斜我的叠加图像来设置面部正确.

请帮助我,接受或邀请任何建议或想法.

提前致谢

快乐编码:)

image-manipulation face-recognition ios

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

如何显示imageview倾斜?

我想展示我的image view一些,arbitrary degrees tilted而不是just simple straight如何转换它显示倾斜?请帮我.

编辑

这是目前的图像视图 在此输入图像描述

我想要这样 只有带有白色边框的图像框架才会倾斜或倾斜

只有白色边框图像视图我想倾斜(倾斜)而不是平铺

transformation uiimageview ios

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

如何在iphone应用程序中设置UIFont粗体

我想设置的字体UILabel,以黑体加粗,但它只是显示正常字体.

我正在使用下面的代码

UILabel *labelHeadingOne = [[UILabel alloc] initWithFrame:CGRectMake(22,260, 504, 20)];
labelHeadingOne.backgroundColor = [UIColor clearColor];

labelHeadingOne.font=[UIFont fontWithName:@"Helvetica" size:16];

labelHeadingOne.text=@"Pre-emergent herbicide with residual control for warm-season turf";
Run Code Online (Sandbox Code Playgroud)

iphone xcode uilabel

0
推荐指数
2
解决办法
6909
查看次数