小编Ket*_*nde的帖子

xcode超时等待应用程序启动

应用程序无法在具有iOS 6.0的设备中从xcode 4.5启动.Xcode表示无法启动应用程序超时等待应用程序启动.我重置了所有设备设置.交叉检查我是否选择了正确的配置.是的这是对的.在这里我附加控制台的图像.请帮帮我. 在此输入图像描述

objective-c ipod-touch xcode4.5

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

来自os:app的警报可能会减慢你的iPhone速度

HY,

我已将应用程序上传到App Store,同时使用这两种架构.请参阅所附的图像Build SettingsTARGETSArchitectures.幸运的是,它准备出售,但iPhone 5s提供警报.

在此输入图像描述

警告是:"APP"可能会降低iPhone的速度.此应用程序的开发人员需要更新它以提高其兼容性.

我用谷歌搜索,但没有找到解决方案摆脱这个警报.另一方面,我还需要支持iPhone5和之前的(32位架构).请帮忙.

architecture iphone ios10

20
推荐指数
4
解决办法
8964
查看次数

验证UITextField中的电子邮件地址

我想在包含电子邮件地址的文本字段中进行验证.
在字符串"emailRegEx"中添加什么来限制用户在电子邮件地址中插入三个点或者我必须在方法中写入相同的内容.

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string. 
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

- (BOOL)EmailValidationL:(NSString *)email
{
    NSString *emailRegEx =@"(?:[a-z0-9!#$%\\&'*+/=?\\^_`{|}~-]+(?:\\.[a-z0-9!#$%\\&'*+/=?\\^_`{|}"
    @"~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\"
    @"x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-"
    @"z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5"
    @"]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-"
    @"9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21"
    @"-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])";

    NSPredicate *regExPredicate =
    [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegEx];
    a= [regExPredicate evaluateWithObject:email];
    return a;
}
Run Code Online (Sandbox Code Playgroud)

iphone objective-c email-validation ios swift

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

NSData dataWithContentsOfURL

我有这个按钮点击(下载)的方法.问题是由于异常而终止:

[Session started at 2011-03-14 13:06:45 +0530.]
2011-03-14 13:06:45.710 XML[7079:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** -[NSCFString isFileURL]: unrecognized selector sent to instance 0x62b8'
-(IBAction) download
{
    UIImage *image = [UIImage imageWithData: [NSData dataWithContentsOfURL:@"http://ws.cdyne.com/WeatherWS/Images/thunderstorms.gif"]];
    [image release];
}
Run Code Online (Sandbox Code Playgroud)

问题是什么?

iphone nsurl uiimage nsdata

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

UITableViewCell和UITableView(确实选择了一行)导航到otherViewcontroller

我甲肝UITableViewCellUITableView在上的特定行单view.Clicking UITableView,它定位到anotherViewController.But我不能够浏览到otherViewController上点击UITableViewCell.如何可以我这样做?

因为UITableView我使用此代码:

-(void)pushView1:(id)sender{
    if(edController == nil)
    edController = [[EditableDetailCell alloc] initWithNibName:@"EditableDetailCell" bundle:[NSBundle mainBundle]];
    [self.navigationController pushViewController:edController animated:YES];
}
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    UITableViewCell *tbcel;
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    tbcel.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    tbcel.layer.cornerRadius = 15;
    tbcel.text = aBook.Name;
    switch(indexPath.section)
    {
         case 0:
            cell.text = aBook.Address;
            break;
        case …
Run Code Online (Sandbox Code Playgroud)

iphone

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

单击DetailDisclosureButton导航?

我在UITableViewcell中使用披露btn.当我使用:

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

它导航到anotherViewController,当我使用它时,它不会导航btn点击

cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;

点击DetailDisclosureButton,我该怎么办?

iphone

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

用字符串识别表情符号字符并重新表达所有字符串

我得到了NSString来自UIWebView包含iPhone的表情符号,但不包括表情符倒车文本.我需要NSString再次显示反向,UIWebView但无法使用表情符号获取反向字符串.我没有在字符串中识别表情符号字符.我有iOS 6.0的xcode 4.5.这是我的代码:

 - (NSString *) createReverseStringFromString:(NSString *)inputString {
  if (inputString.length <= 0)
    return inputString;

 NSMutableString *mutableReverseString = [[NSMutableString alloc] 
 initWithCapacity:inputString.length];
 Thfor (NSInteger i = inputString.length -1; i >= 0; i--) {

    NSString *characterString = [inputString substringWithRange:NSMakeRange(i, 1)];
    [mutableReverseString appendString:characterString];

    NSLog(@"mutableReverseString..%@",mutableReverseString);
 }

 NSString *outputString = [mutableReverseString copy];
 [mutableReverseString release];
return [outputString autorelease];
 }
Run Code Online (Sandbox Code Playgroud)

objective-c

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

如何将数组中的多个值从逗号分隔为字符串

我试图使用componentsSeparatedByString:@","将字符串插入到具有多个值的数据库中.我得到了"arrayp1net"中的所有值,但问题是如何创建一个包含以逗号(,)分隔的数组"arrayp1net"的所有值的字符串?

if(p1h < 18)
{
    for(int k=0;k<[arrayp1 count];k++)
    {
        if([[hcar1 objectAtIndex:1]intValue] >= [[ar33 objectAtIndex:k] intValue])
        {
            NSString *str = [NSString stringWithFormat:@"%d",[[[arrayp1 objectAtIndex:k] text] intValue] -1];
            [arrayp1net addObject:str];        
           }
        else
        {
            NSString *str = [NSString stringWithFormat:@"%d",[[[arrayp1 objectAtIndex:k] text]intValue]];
            [arrayp1net addObject:str];
            player1netscore = [NSString stringWithFormat:@"%@",arrayp1net];
        }
    }
Run Code Online (Sandbox Code Playgroud)

是的我需要相同但我必须在数据库中插入一行查询,所以当我要去取,我取得所有的原样.

query=[NSString stringWithFormat:@"insert into normalscoring  
(gameid,coursename,p1,p2,p3,p4,p1s,p2s,p3s,p4s,gameDate,p1nets,p2nets,p3nets,p4nets)  
 values (\'%@\',\'%@\',\'%@||%@\',\'%@||%@\',\'%@||%@\',\'%@||%@\',
 ',,,,,,,,,,,,,,,,,||0||0||0||0',
 ',,,,,,,,,,,,,,,,,||0||0||0||0',
 ',,,,,,,,,,,,,,,,,||0||0||0||0',
 ',,,,,,,,,,,,,,,,,||0||0||0||0',
  \'%@\',',,,,,,,,,,,,,,,,,',
 ',,,,,,,,,,,,,,,,,',',,,,,,,,,,,,,,,,,',',,,,,,,,,,,,,,,,,')",
 txtgameid.text,txtcoursename.text,txtplayer1.text,player1handicap,
 txtplayer2.text,player2handicap,txtplayer3.text,player3handicap,
txtplayer4.text,player4handicap,txtdate.text];
Run Code Online (Sandbox Code Playgroud)

这是我在if语句之后尝试做但是得到例外

player1netscore = [NSString stringWithFormat:@"%@",arrayp1net];
arn11=[player1netscore componentsSeparatedByString:@","];
player1netscore=[[arn11 objectAtIndex:0] objectForKey:@"p1nets"];
NSLog(@"player1netscore...%@",player1netscore);
Run Code Online (Sandbox Code Playgroud)

iphone ios

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

对具有范围对象的NSMutablearray进行排序

我已将范围对象添加到NSMutable数组,即[{5,12} {0,4} {18,10}].现在我想按递增顺序对这个NSMutable数组进行排序.我使用以下代码以递增的顺序获取NSMutable数组对象.

        NSArray *stringIndexes = [StringIndexes copy];
        stringIndexes = [stringIndexes sortedArrayUsingSelector:@selector(compare:)];
        NSLog(@"stringIndexes..:%@",stringIndexes);
Run Code Online (Sandbox Code Playgroud)

但它没有提供所需的输出.如果有人知道如何对具有范围对象的NSMutable数组进行排序.请帮帮我.

谢谢大家.

iphone objective-c ios

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