我想显示一条警告消息"你已经使用了5倍以上的下一版本".
我们应该如何计算启动次数以及我们将此警报视图称为何处?
我使用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];
它被清除了所有缓存,因此下一次迭代的缓存中没有数据.
我的应用程序在应用程序中有很多按钮
我想一次将所有这些设置为Exclusive Touch.或应用程序中的所有视图
我们可以单独设置
[button setExclusiveTouch:YES];
Run Code Online (Sandbox Code Playgroud)
但我想一次设置应用程序中的所有按钮
我们可以设置所有视图独家触摸吗?
任何身体有任何想法请建议我.
最近我从Client 获得了对我的iTunesConnect帐户的ADMIN访问权限.
当我试图从myApps添加新应用程序时,我没有获得添加新iOS应用程序或创建捆绑包的任何选项.如图2所示
任何人都可以建议我们是否需要从客户方或我方做任何事情.
登录后立即收到有关税收等的通知.如图1所示
图1:显示未知通知

图2:清空弹出窗口

我有一个包含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)
我怎么得到它..提前谢谢
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两个标签之间没有间隙.
在我的应用程序中我有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) 我试过这个代码如下
这有助于我允许用户只输入数字和点(小数点)
但问题是用户可以在此方法中允许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)
如何允许用户只输入一个十进制文本字段,该字段也只允许小数点后的两位数
提前致谢
在我的应用程序中,我需要在 UILabel 中重复显示“正在加载”文本,如下所示:
加载中。加载中.. 加载中... 加载中 加载中。加载中.. 加载中...
我该怎么做?请问有什么建议吗?
通常我们总是使用以下方法从一个视图推送到另一个视图:
[self.navigationController pushViewController:nextView animated:YES];
for some other animations we used :UIViewAnimationTransitionCurlDown / flipRight etc etc..
所有这些都经常使用,
但我希望我的应用程序具有不同的转换 ..
过渡中的任何其他自定义过渡/特殊效果..(推/弹出)或动画的任何其他外部api ..
iphone objective-c uinavigationcontroller pushviewcontroller
众所周知,当我们打开和关闭底部控制中心/顶部通知中心时,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 的代码
objective-c ×10
iphone ×9
ios ×4
xcode ×3
uitableview ×2
caching ×1
nsarray ×1
nsdictionary ×1
nspredicate ×1
push ×1
uibutton ×1
uilabel ×1
uitextfield ×1