我想从选择记录'2013-04-01 00:00:00'到'today',但是,每一天都有很多的价值,因为他们节省每次15分钟的值,所以我想只能从每天的第一个或最后一个值.
表模式:
CREATE TABLE IF NOT EXISTS `value_magnitudes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`value` float DEFAULT NULL,
`magnitude_id` int(11) DEFAULT NULL,
`sdi_belongs_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`reading_date` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1118402 ;
Run Code Online (Sandbox Code Playgroud)
错误的SQL:
SELECT value FROM `value_magnitudes` WHERE `value_magnitudes`.`reading_date` BETWEEN '2013-04-01 00:00:00' AND '2013-04-02 00:00:00' AND (`value_magnitudes`.magnitude_id = 234) LIMIT 1
SELECT value FROM `value_magnitudes` WHERE `value_magnitudes`.`reading_date` …Run Code Online (Sandbox Code Playgroud) 我有mainViewController,但我有一个小的UIView,当你点击一个内部被激活MKAnnotationView的MKMapKit,所以我需要UIView为可拖动在屏幕的任何部分.
我的应用的示例屏幕截图:

圆是一个点的例子,我想我可以拖动"小"UIView的任何一点.
我尝试使用,UITapGestureRecognizer但它没有用,因为我的代码不够好,我无法使它可拖动,因为它只是点击,而不是点击和移动.
我希望你能帮助我.
我知道我必须在我的UIView中插入一个UIScrollView并在我的viewLoad中放入我的IBOutlet UIScrollView的sizeContent,但我有一些疑问,因为它对我不起作用,我想有一些信息不适合我.
我的UIView大小是320x678,所以我需要向下/向上滚动它,我用谷歌搜索但是一些方法但总是崩溃或不起作用,我将目标部署到iOS 4.3,以便我的应用程序适用于所有iOS> = 4.3,我现在正需要帮助澄清我的想法......
从开始到结束我应该采取什么步骤?滚动视图应该在所有控制器的前景或背景上?
编辑:我这样做了....
|-button-||-imgview-||-button-| |-some-|
|-------scrollview content size--------| Size = 320x678
|--------------scrollview--------------| Size = 320x678
|----------------view------------------| Size = 320x678
Run Code Online (Sandbox Code Playgroud)
可能这是我的错误,但是,为什么我不能让我的iPhone可滚动?
|-----iPhone screen-----|
|-------------My app------------|
Run Code Online (Sandbox Code Playgroud)
如果我没有做任何类型的技巧滚动我不会看到比我的iPhone屏幕更多,没有任何自动滚动的那种"问题"?或者我必须这样做你告诉我的?
因为现在我的问题是我必须重建我的.xib并且我真的不明白该怎么做,我理解的理论但不是如何理解.
EDIT2:
我修改了你的理论.
1.- I created a Iphone screen 3.5
2.- I created an auxiliar view with freeform and adapted to 320x678
3.- I designed my 320x678 view
4.- In my main .xib I added my scroll IBOutlet and in the IB then linked.
5.- On my loadview I added …Run Code Online (Sandbox Code Playgroud) 我有这个函数来向表中插入数据:
public static function insertSistema($name,$description,$created_at, $updated_at, $img_file_name, $img_content_type, $img_file_size, $img_updated_at, $visible, $description, $access_floors, $access_procedures, $access_datas, $access_histories, $access_incidences, $access_operations, $access_reports, $access_messagings)
{
$conector = new Conexion("localhost","xrem_prueba");
try
{
$con = $conector->Conectar();
$con->exec('SET CHARACTER SET utf8');
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$consulta = $con->prepare("INSERT INTO systems (name, created_at, updated_at, img_file_name, img_content_type, img_file_size, img_updated_at, visible, description, access_floors, access_procedures, access_datas, access_histories, access_incidences, access_operations, access_reports, access_messagings ) VALUES (:name, :created_at, :updated_at, :img_file_name, :img_content_type, :img_file_size, :img_updated_at, :visible, :description, :access_floors, :access_procedures, :access_datas, :access_histories, :access_incidences, :access_operations, :access_reports, :access_messagings);");
$consulta->bindParam(':name', $name, PDO::PARAM_STR, …Run Code Online (Sandbox Code Playgroud) 我正在使用String.split()将一些字符串划分为IP但是它returning an empty array,所以我使用String.substring()解决了我的问题,但我想知道为什么不按预期工作,我的代码是:
// filtrarIPs("196.168.0.1 127.0.0.1 255.23.44.1 100.168.100.1 90.168.0.1","168");
public static String filtrarIPs(String ips, String filtro) {
String resultado = "";
String[] lista = ips.split(" ");
for (int c = 0; c < lista.length; c++) {
String[] ipCorta = lista[c].split("."); // Returns an empty array
if (ipCorta[1].compareTo(filtro) == 0) {
resultado += lista[c] + " ";
}
}
return resultado.trim();
}
Run Code Online (Sandbox Code Playgroud)
它应该返回String[] as {"196"."168"."0"."1"}....
几天前我是问如何从FTP下载文件和我的求解器我用这种NSData的和dataWithContentsOfURL问题:
ftp://user:pass@server/path/of/file.extension
但现在我需要上传一个文件,我想知道是否有任何指令通过URL上传文件,但我认为这是不可能的,我看到的许多库使用PHP而我不想要它,来自Apple的SimpleFTPSample让初级开发人员感到困惑,我什么都听不懂,所以上传文件的简单代码指定了URL,Path,File,user和pass?
我想知道为什么我的iOS应用程序崩溃(部署目标iOS 4.3 - xcode 4).
我在iPad模拟器5.0到6.1中进行了测试,并在我的iPad上使用iOS 4.3进行了100%的测试(好吧,它不是我的,所以我不能更新iOS但是用旧的iOS版本练习很好)让应用程序崩溃说:
2013-02-07 16:07:45.093 GeoRuta[169:707] -[mainViewController presentViewController:animated:completion:]: unrecognized selector sent to instance 0x331960
2013-02-07 16:07:45.113 GeoRuta[169:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[mainViewController presentViewController:animated:completion:]: unrecognized selector sent to instance 0x331960'
*** Call stack at first throw:
(
0 CoreFoundation 0x30f8064f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x32828c5d objc_exception_throw + 24
2 CoreFoundation 0x30f841bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x30f83649 ___forwarding___ + 508
4 CoreFoundation 0x30efa180 _CF_forwarding_prep_0 + 48
5 GeoRuta 0x00003781 -[mainViewController …Run Code Online (Sandbox Code Playgroud) 我只想解析从Post Response收到的字符串,我知道有像NSXMLParse这样的lib /类,而apple提供了一些例子但不是我想要的,或者我还没准备好理解那些代码.
我收到了这个:
<object>
<id>1</id>
<alias>juan</alias>
<email>jps@sol.pro</email>
</object>
<object>
<id>2</id>
<alias>juana</alias>
<email>jpsa@sol.pro</email>
</object>
Run Code Online (Sandbox Code Playgroud)
然后我需要解析,并得到这样的数据:
NSString *xmlThing = [response];
for xmlThing in-all <object>
{
uint id = <id>1</id>
NSString *alias = <alias>juan</alias>
NSString *email = <email>email@email.com</email>
}
Run Code Online (Sandbox Code Playgroud)
为什么这样?因为我认为最简单的方法是解析所有类型的html,xml等文件.
我感谢所有的帮助.
ios ×5
objective-c ×3
xcode ×3
mysql ×2
php ×2
uiview ×2
draggable ×1
ftp ×1
insert-into ×1
java ×1
pdo ×1
split ×1
sql ×1
string ×1
string-split ×1
touchesmoved ×1
uiscrollview ×1
upload ×1
xml ×1
xml-parsing ×1