小编Sri*_*vas的帖子

如何为Nslocal通知设置自定义重复间隔.....?

我是iphone开发的新手.我正在尝试在我的项目中使用NslocalNotification我需要每2小时或每两天或每两个月给予记忆等等.目前我正在使用NslocalNotification重复间隔.但它仅用于工作每小时使用Nscalender的每分钟....

        NSString *InterVal=[freQuencyArr objectAtIndex:index-2];
        NSString *InterValType=[freQuencyArr objectAtIndex:index-1];
        if(![InterVal isEqualToString:@"Every"])
        {  
         result=[InterVal intValue];
        }else
          result=1;
        if([InterValType isEqualToString:@"Day"]){
             notification.repeatInterval= NSDayCalendarUnit;    
        }else if([InterValType isEqualToString:@"Week"]){
            notification.repeatInterval= NSWeekCalendarUnit;    
         }
        else if([InterValType isEqualToString:@"Month"]){
            notification.repeatInterval= NSMonthCalendarUnit;   
        }else if([InterValType isEqualToString:@"days"]){
             notification.repeatInterval=result*24*60*60;
        }
Run Code Online (Sandbox Code Playgroud)

这里如果结果是2取决于IntervalType我需要通知它不能和我一起工作

         if([InterValType isEqualToString:@"days"]){
             notification.repeatInterval=result*24*60*60;
        }
Run Code Online (Sandbox Code Playgroud)

iphone objective-c nsnotifications nsnotificationcenter

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

滑动以删除不适用于自定义单元格

我正在使用自定义单元格并在程序上添加tableview.我正在尝试在我的应用程序中实现滑动功能.当我尝试滑动时,不会调用tableview数据源方法.

tableview = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 460) style:UITableViewStylePlain];
tableview.delegate=self;
tableview.dataSource=self;


tableview.backgroundColor=[UIColor clearColor];
tableview.backgroundColor=selectedBackGroundColor;
tableview.separatorColor = [UIColor clearColor];


tableview.editing=YES;
NSLog(@"%f %f",self.view.frame.size.width,self.view.frame.size.height);
[self.view addSubview:tableview];
Run Code Online (Sandbox Code Playgroud)

这个方法正在调用

-(UITableViewCellEditingStyle)tableView:(UITableView*)tableView editingStyleForRowAtIndexPath:(NSIndexPath*)indexPath 
{
    return UITableViewCellEditingStyleDelete;
}
Run Code Online (Sandbox Code Playgroud)

之后甚至单元格也没有选择...我错过任何代码请帮帮我吗?

iphone uitableview ios

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

申请将终止在以下情况下不工作

我面临着应用程序终止状态的大问题.在我的应用程序中需要满足以下要点.....

1)应用在背景开关到地面(无需存储数据)

2)如果用户回家并终止应用程序(需要存储数据),应用程序是一段时间背景

是否有任何委托方法将在应用程序终止前调用. - (void)applicationWillTerminate:(UIApplication *)application

因为在我们尝试终止应用程序时运行如此暂停的1个案例应用程序没有使用.

请帮我解决这个问题.....如果有任何想法也会被挪用

iphone objective-c ios4

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