小编iOS*_*dev的帖子

我该如何计算iPhone中应用程序的启动次数

  • 我已完成申请.
  • 现在,当用户启动我的应用程序5次
  • 我想显示一条警告消息"你已经使用了5倍以上的下一版本".

  • 我们应该如何计算启动次数以及我们将此警报视图称为何处?

iphone xcode objective-c launching-application

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

iOS + Parse.com:kPFCachePolicyCacheThenNetwork,检索数据两次

我使用Parse.com构建了一个iOS应用程序

我想要从数据高速缓存最初与来自网络,然后

为此,我使用了kPFCachePolicyCacheThenNetwork缓存策略,选择我的要求.

PFQuery *employesquery = [PFQuery queryWithClassName:@"employesTable"];
    [employesquery whereKey:@"UserID" equalTo:[PFUser currentUser]];
    [employesquery includeKey:@"empID"];
    [employesquery includeKey:@"empID.user"];

    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.navigationController.view  animated:YES];


//APPLIES CACHE... ********
        employesquery.cachePolicy = kPFCachePolicyCacheThenNetwork;

    [employesquery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
        [hud hide:YES];
        NSMutableArray *empData = [[NSMutableArray alloc] init];
        for (PFObject *object in objects)
        {
            //Getting Data For Item
            PFObject *employeeObject = [object objectForKey:@"empID"];
            [empData addObject:employeeObject];
        }
        [self fetchEmployeeData:empData];

    }];
Run Code Online (Sandbox Code Playgroud)

但是使用这个每个数据检索两次,可重复的数据.

如何避免这种可重复的数据,

一旦数据从网络获得,先前显示的数据(使用缓存)将被清除/隐藏.

我试过了 [PFQuery clearAllCachedResults];

它被清除了所有缓存,因此下一次迭代的缓存中没有数据.

iphone caching objective-c ios parse-platform

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

objective c如何为整个应用程序上的所有UI按钮设置独占触摸

我的应用程序在应用程序中有很多按钮

我想一次将所有这些设置为Exclusive Touch.或应用程序中的所有视图

我们可以单独设置

[button setExclusiveTouch:YES];
Run Code Online (Sandbox Code Playgroud)

但我想一次设置应用程序中的所有按钮

我们可以设置所有视图独家触摸吗?

任何身体有任何想法请建议我.

iphone objective-c uibutton ios

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

无法添加新的iOS应用程序,在iTunes连接中创建捆绑包

最近从Client 获得了对我的iTunesConnect帐户的ADMIN访问权限.

当我试图从myApps添加新应用程序时,我没有获得添加新iOS应用程序或创建捆绑包的任何选项.如图2所示

任何人都可以建议我们是否需要从客户方或我方做任何事情.

登录后立即收到有关税收等的通知.如图1所示

图1:显示未知通知 图1:显示未知通知


图2:清空弹出窗口 在此输入图像描述

itunesconnect ios

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

使用NSDictionary数组中的值获取Array

我有一个包含4个词典的数组,其键为@"首选项",如下所示

 (
        {
          preference = Nose;
        },

        {
          preference = "Heart rate";
        },

        {
          preference = Glucose;
        },

        {
          preference = Food;
        }
)
Run Code Online (Sandbox Code Playgroud)

现在我想检索这些字典值的数组,如"

 (
    Nose, Heart rate,  Glucose,  Food
 )
Run Code Online (Sandbox Code Playgroud)

我怎么得到它..提前谢谢

iphone objective-c nsdictionary nsmutablearray nsarray

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

如何在tableview单元格iphone中设置textLabel的位置

  • 在我的表视图中,我使用的是UITableviewCEllStyleValue1:

 if (cell == nil) 
        {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease];

     cell.textLabel.text = @"Hai";
                cell.detailTextLabel.text = @"Hello";

        cell.detailTextLabel.textAlignment = UITextAlignmentLeft;
        cell.textLabel.textAlignment = UITextAlignmentLeft;
        return cell;

        }
Run Code Online (Sandbox Code Playgroud)
  • 这里显示两个标签文本labe,detailTextLabel.

  • 但不是我想要的位置.

  • 我需要从单元格的起始位置显示Textlable(0,0)并且immidiate右侧位置是detailTextlabel两个标签之间没有间隙.

  • 我需要一个不使用Allignment的解决方案.该怎么办?

iphone xcode objective-c uitableview

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

当我点击iPhone中的导航栏时,如何弹出所需的视图控制器

在我的应用程序中我有6个不同的视图控制器 1.主页2.表视图3.表视图元素的详细信息,这也是一个包含4行的表视图4. 4,5,6编辑/修改视图的详细信息(详细信息表中的每一行都可以修改和重新加载)

在4,5,6视图中编辑详细信息视图的数据时,导航将被推送到第2视图详细信息视图.

当我点击后面的导航细节时,它会弹出到最近修改的上一个视图.但是我需要弹出(推到左/后侧而不是推到右侧)到tableview1,所以我为这个按钮创建了一个leftnavigation项目实现的动作.

UIBarButtonItem *backButton = [[[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(backclick:)] autorelease];
    self.navigationItem.leftBarButtonItem = backButton;
Run Code Online (Sandbox Code Playgroud)

在click acitio中,我使用了三种不同的方法

1.popToRootViewcontroller : it takes back to the home page. so ,didn't need it (X)
2.[self.navigationController pushViewController:abc animated:YES]; it pushes right/front (X)
3.present model view controller
Run Code Online (Sandbox Code Playgroud)

一切正在工作,并采取到表视图,但没有在正确的方向,即不弹出到后面只是pusshes到前面.所以,我使用了popto viewcontoller.

4.popViewController(这是我猜的正确的过程)但它崩溃并显示错误视图soesnot exixst

-(IBAction)backclick:(id)sender
{
    ChronologyViewController *temp = [[ChronologyViewController alloc]initWithNibName:@"ChronologyViewController" bundle:nil];
        [self.navigationController popToViewController:temp animated:YES];
}
Run Code Online (Sandbox Code Playgroud)

iphone push objective-c uitableview uinavigationcontroller

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

价格ui文本字段:如何允许用户只在文本字段中输入一个小数点,价格为283.99

我试过这个代码如下

这有助于我允许用户输入数字和点(小数点)

问题是用户可以在此方法中允许n个小数.

我想只允许一个小数

并且只有两位数后才会出现

喜欢123.00,123423432353.99 但不喜欢123.4.4,123.12345,123 ...... 23

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{


      if (string.length == 0) {
            return YES;
      }
      NSCharacterSet *myCharSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789."];
      for (int i = 0; i < [string length]; i++) {
            unichar c = [string characterAtIndex:i];
            if ([myCharSet characterIsMember:c]) {
                  return YES;
            }
      }
      UIAlertView *av = [[UIAlertView alloc] initWithTitle:nil message:@"Invalid input" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
      [av show];
      return NO;

}
Run Code Online (Sandbox Code Playgroud)

如何允许用户只输入一个十进制文本字段,该字段也只允许小数点后的两位数

提前致谢

iphone objective-c uitextfield nspredicate

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

Objective-C:如何为 UILabel 上的“正在加载...”文本设置动画

在我的应用程序中,我需要在 UILabel 中重复显示“正在加载”文本,如下所示:

加载中。加载中.. 加载中... 加载中 加载中。加载中.. 加载中...

我该怎么做?请问有什么建议吗?

iphone objective-c uilabel uiviewanimation

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

navigationController:pushViewController,具有iPhone事务的特殊效果

通常我们总是使用以下方法从一个视图推送到另一个视图:

[self.navigationController pushViewController:nextView animated:YES];

for some other animations we used :UIViewAnimationTransitionCurlDown / flipRight etc etc..

所有这些都经常使用,

我希望我的应用程序具有不同的转换 ..

过渡中的任何其他自定义过渡/特殊效果..(推/弹出)或动画的任何其他外部api ..

iphone objective-c uinavigationcontroller pushviewcontroller

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

如何仅在applicationDidBecomeActive中触发“通知中心或控制中心”时检查

众所周知,当我们打开和关闭底部控制中心/顶部通知中心时,applicationDidBecomeActive 就会被调用。

但我想知道在 applicationDidBecomeActive 中,仅由于这两个事件,才能在用户打开和关闭通知中心或控制中心时处理某些功能。

- (void)applicationDidBecomeActive:(UIApplication *)application
{

    if(/*Code for DidBecomeActive Called Because of Contol Center*/ --- )
    {

    }


if(/*Code for DidBecomeActive Called Because of Notification Center*/)
    {

    }


}
Run Code Online (Sandbox Code Playgroud)

有谁帮我查一下

由于通知中心而调用 DidBecomeActive 的代码

由于控制中心而调用 DidBecomeActive 的代码

xcode objective-c ios notificationcenter control-center

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