这可能是我想要的简单事情,但我已经设置了位置服务(为了清晰起见缩短了):
- (void)viewDidLoad
{
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self;
[self.locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSLog(@"%@",newLocation.coordinate.latitude);
NSLog(@"%@",newLocation.coordinate.longitude);
}
Run Code Online (Sandbox Code Playgroud)
工作正常,并给我一个位置数据流到日志.
但我想要的是能够立即在ViewDidLoad中获取当前位置,因为我只需要它一次,而不是一次不断更新 - 它只是为了找到"最近"的便利设施,所以我可以向用户报告.我试过添加:
self.locationLat = [self.locationManager location].coordinate.latitude;
self.locationLng = [self.locationManager location].coordinate.longitude;
Run Code Online (Sandbox Code Playgroud)
在startUpdatingLocation之后立即到ViewDidLoad,但它们总是以null形式出现.还有什么我需要调用才能在运行后获取数据吗?
谢谢
我想我已经将我的第一个项目打成了一个结点,通过链接到一个不在主文件夹结构中但位于其他地方的图像 - 试图理顺它,我现在得到这些警告:
[WARN]Warning: Multiple build commands for output file /Users/davebennett/Library/Developer/Xcode/DerivedData/The_Dogs-djvmthbassvcpifzucvcjpgktemi/Build/Products/Debug-iphonesimulator/GBGB.app/dashboard-button.png
Run Code Online (Sandbox Code Playgroud)
有人能指出我如何追踪这些并正确处理它们的正确方向吗?
谢谢
希望有人能帮忙解决这个问题.我一直在网络上,并通过这个网站寻找答案,但仍然无法使Autocomplete AJAX控件工作.我试图将它包含在一个现有的网站中,直接将其剥离回一个非常基本的形式,但它仍然无法运行.我使用页面方法而不是本地Web服务有更多的运气,所以这是我的代码
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="droptest.aspx.cs" Inherits="droptest" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">
</asp:ScriptManager>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"
MinimumPrefixLength="1" ServiceMethod="getResults"
TargetControlID="TextBox1">
</cc1:AutoCompleteExtender>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Services;
using System.Web.Services;
public partial class droptest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) …Run Code Online (Sandbox Code Playgroud) 我有一个多页模板设置.我的主屏幕背景颜色与其他页面不同,但我发现我在页面中添加的一些内容不够长,无法到达页脚,我看到了默认的背景颜色设置主屏幕背景和页脚之间.
有没有办法在切换到页面之前更改页面的ui页面背景颜色,这样可以正确填补空白?
我考虑过委托代表为页面做的事情:
$(document).delegate("#pageDetail", "pagecreate", function () {
$('.ui-page').css('background-color', '#ECF2FE');
});
Run Code Online (Sandbox Code Playgroud)
但是当你按下后退按钮时它就会中断,因为它会让变化保持原位.
是否有一个事件我可以使用这个更改将触发,以便我可以为每个页面设置正确的背景颜色 - 或者是否有一个更简单的方法我缺少?
谢谢
我正在尝试准备工作报告,我需要查看客户是否已取消并重新提交订单.没有任何方法可以链接两个订单,我必须继续的是customer_id,order_date和状态.我需要找到特定日期范围内的所有客户,这些客户在同一天放置了多个订单记录,以便返回customer_id就够了
order_id customer_id order_date status
1 1234 30/12/2013 09:10:55 CANCELLED
2 2222 30/12/2013 09:17:12 APPROVED
3 4321 30/12/2013 10:04:10 APPROVED
4 1234 30/12/2013 10:22:01 APPROVED
Run Code Online (Sandbox Code Playgroud)
在上面的示例数据中,它将找到订单1和4并返回customer_id 1234.状态是什么并不重要,因为我无论如何都可以从报告中选择那些.
我做了一些挖掘,想出了类似的东西:
SELECT customer_id,
(SELECT COUNT(*) AS count
FROM orders AS o2
WHERE (order_date = o1.order_date)) AS counter
FROM orders AS o1
WHERE (order_date BETWEEN '2013-12-01' AND '2014-01-01')
GROUP BY customer_id, order_date
HAVING (counter >= 2)
Run Code Online (Sandbox Code Playgroud)
但是我在尝试运行时遇到错误,所以我显然在某处出现了一些错误.
任何帮助,将不胜感激.
asp.net-ajax ×1
autocomplete ×1
c# ×1
css ×1
ios ×1
ios4 ×1
javascript ×1
jquery ×1
sql ×1
sql-server ×1
t-sql ×1