问题列表 - 第32261页

iPhone:如何设置重复每日/每小时本地通知?

我想测试添加本地通知.我希望它每天/每小时重复一次.我怎样才能做到这一点?

NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];

 // Get the current date
    NSDate *now = [NSDate date];

 // Break the date up into components
NSDateComponents *dateComponents = [calendar components:( NSYearCalendarUnit |       NSMonthCalendarUnit |  NSDayCalendarUnit )
           fromDate:now];

NSDateComponents *timeComponents = [calendar components:( NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit)
           fromDate:now];


 // Set up the fire time
NSDateComponents *dateComps = [[NSDateComponents alloc] init];

[dateComps setDay:[dateComponents day]];
[dateComps setMonth:[dateComponents month]];
[dateComps setYear:[dateComponents year]];

[dateComps setHour:[timeComponents hour]];
 [dateComps setMinute:[timeComponents minute]];
 [dateComps setSecond:[timeComponents second]+10];

 // Notification will fire …
Run Code Online (Sandbox Code Playgroud)

iphone notifications local repeat ios4

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

我们如何解决Cisco CSS引起的间歇性"强制关闭的现有连接"错误

我们拥有"标准"三层架构,我们的中间层托管在IIS中,并通过.net远程访问.这些错误发生在远程连接到应用服务器(中间层)的Web和Web服务服务器(前端层)之间.我们将在当天总计约130K的电话中每天3-10次收到此错误.

异常和堆栈跟踪看起来总是类似于:


Exception Type: System.Net.WebException
Message: The underlying connection was closed: An unexpected error occurred on a receive.

Server stack trace: 
   at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessResponseException(WebException webException, HttpWebResponse& response)
   at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at XXXXX.BusinessFacade.Interface.XXXXInterface.SubmitXXXX(
   at XXX.XXXXWebServicesLibrary.XXXXService.CreateXXXXXX.RunXXXXMethod()
   at XXX.XXXXWebServicesLibrary.XXXXService.XXXXXXMethod`2.RunMethod()
   at XXX.XXXXWebServicesLibrary.XXXXXWebMethod`2.Run()HandleReturnMessage()
Inner Exception: 

Exception Type: System.IO.IOException
Message: Unable to read data from the transport connection: An existing connection was …
Run Code Online (Sandbox Code Playgroud)

iis networking firewall .net-remoting

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

如何在警报对话框中添加两个编辑文本字段

我正在尝试使用警告对话框来提示在android中输入用户名和密码.我在这里找到了这段代码:

  if (token.equals("Not Found"))
    {
        LayoutInflater factory = LayoutInflater.from(this);            
        final View textEntryView = factory.inflate(R.layout.userpasslayout, null);

        AlertDialog.Builder alert = new AlertDialog.Builder(this); 

        alert.setTitle("Please Login to Fogbugz"); 
        alert.setMessage("Enter your email and password"); 
        // Set an EditText view to get user input  
        alert.setView(textEntryView); 
        AlertDialog loginPrompt = alert.create();

        final EditText input1 = (EditText) loginPrompt.findViewById(R.id.username);
        final EditText input2 = (EditText) loginPrompt.findViewById(R.id.password);

        alert.setPositiveButton("Login", new DialogInterface.OnClickListener() { 
        public void onClick(DialogInterface dialog, int whichButton) { 
            input1.getText().toString(); **THIS CRASHES THE APPLICATION**


        } 
        }); 

        alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { …
Run Code Online (Sandbox Code Playgroud)

android dialog login

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

将Apple的型号标识符(MacBookPro5,1)翻译成用户友好名称?

Mac OS X是否有API将Apple的模型标识符(plists和API中的类型,例如"MacBookPro5,1")转换为这些设备的用户友好营销名称("Unibody MacBook Pro Late 2008")?

我正在寻找比简单硬编码列表更具前瞻性的解决方案.

macos cocoa branding hardware-id

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

Try Catch错误处理的最佳实践

我试图避免在捕获时返回不正确的值,但我找不到比这更好的解决方案:

    private SecurityLevel ApiGetSecurityLevel()
    {
        try
        {
            return _BioidInstance.GetSecurityLevel();
        }
        catch
        { 
            return SecurityLevel.High;
        }
    }
Run Code Online (Sandbox Code Playgroud)

有没有更好的方法这样做,所以我不返回不正确的值?我无法更改SecurityLevel枚举.

.net exception-handling exception

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

Javascript:检查对象是否没有属性,或者map/associative-array是否为空

可能重复:
如何从JSON测试空Javascript对象?

在Javascript中是否有一种简单的方法来检查对象是否没有属性?或者换句话说,检查地图/关联数组是否为空的简单方法?例如,假设您有以下内容:

var nothingHere = {};
var somethingHere = {foo: "bar"};
Run Code Online (Sandbox Code Playgroud)

有没有一种简单的方法来判断哪一个是"空的"?我唯一能想到的是这样的事情:

function isEmpty(map) {
   var empty = true;

   for(var key in map) {
      empty = false;
      break;
   }

   return empty;
}
Run Code Online (Sandbox Code Playgroud)

有没有更好的方法(像本地财产/功能或其他东西)?

javascript associative-array map is-empty object-property

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

网站没有显示(说它失败),没有用户代码被调用

该网站加载app_offline.htm.

用于加载精细的应用程序,我不确定什么是错的,我正在寻找一个指针.它无法加载应用程序.这个托管在开发asp.net服务器上

要获得此调用堆栈,我必须在System.Web.HttpExecption中启用第一次机会异常,这里是"控制台"输出

System.Web.dll中发生类型'System.Web.HttpException'的第一次机会异常System.Web.dll中出现类型'System.Web.HttpException'
的第一次机会异常
附加信息:ASP.NET初始化错误:
A System.Web.dll中发生'System.Web.HttpException'类型的第一次机会异常
附加信息:ASP.NET初始化错误:

第一个execption的调用堆栈.

System.Web.dll!System.Web.HttpRuntime.CheckApplicationEnabled()第1269C行#
System.Web.dll!System.Web.HttpRuntime.FirstRequestInit(System.Web.HttpContext context = {System.Web.HttpContext})第579C行#
System.Web.dll!System.Web.HttpRuntime.EnsureFirstRequestInit(System.Web.HttpContext context)第652C行#
System.Web.dll!System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest wr = {Microsoft.VisualStudio. WebHost.Request})行1582 + 0x9 bytesC#
System.Web.dll!System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest wr)Line 2270C#
System.Web.dll!System.Web.HttpRuntime.ProcessRequest(System .Web.HttpWorkerRequest wr)2256C行#

c# asp.net

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

活动指标视图

活动指标视图如何运作?

你能把它拖放到屏幕上吗?

xcode ipad

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

从java中的列表构建分隔字符串的最佳方法

我有一个对象列表,每个对象都有一个字符串属性.例如,我有一个List<Person>,每个Person都有一个firstName属性.我想构建一个逗号分隔的引用字符串,如下所示:

'James', 'Lily', 'Michael'
Run Code Online (Sandbox Code Playgroud)

考虑到java似乎没有连接方法(此外,这比简单的分隔字符串更复杂),最简单的方法是什么?我一直在尝试编写这个代码,但我的代码变得非常混乱,我可以使用一些新的输入.

java string join delimiter

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

CSS:Dropdown浮在上面

所以我在html/css/js中有这个下拉列表..它在鼠标悬停时向下滑动,但是现在它向下滑动错误,我的意思是它将我的文本向下移动,我不想让它做...我希望它像浮动在它上面所以文本在菜单后面

  • 左边是它的样子,右边是鼠标悬停的时候.正如你可以看到"示例我"文本我不希望它向下移动,我希望菜单像浮在上面所以当你再次移开鼠标时你可以看到"示例我"

    这是菜单的css:

    .menu_class {
        border:1px solid #1c1c1c;
    }
    
    .the_menu {
        display:none;
        width:150px;
        border: 1px solid #1c1c1c;
    }
    
    .the_menu li {
        background-color: #283d44;
    }
    
    .the_menu li a {
        color:#FFFFFF; 
        text-decoration:none; 
        padding:10px; 
        display:block;
    }
    
    .the_menu li a:hover {
        padding:10px;
        font-weight:bold;
        color: #fffc30;
    }
    
    <img src="images/button.png" width="126" height="23" class="menu_class">
    <ul class="the_menu">
    <li><a href="#">Profil</a></li>
    
    </ul>
    
    Run Code Online (Sandbox Code Playgroud)
  • css drop-down-menu

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