我正在处理我的应用程序,然后没有在哪里,我得到这个构建错误,无法弄清楚为什么它不会消失.显然它认为我错过了某种类型的脚本.别人都知道为什么?我正在使用Xcode 4.5.1.
/ bin/sh:/Users/JonErickson/Library/Developer/Xcode/DerivedData/FireCom-cygbnsedlgybvdewalvvmzqeehlc/Build/Intermediates/FireCom.build/Debug-iphonesimulator/FireCom.build/Script-C8CC6BE415FAAB4C001BB67E.sh:( null):bad interpreter : 没有相应的文件和目录
我有一个mapview,其中注释的坐标不断更新,但是当我使用setCoordinate时,注释不会移动.如何刷新注释以反映其坐标?
- (void)updateUnits {
PFQuery *query = [PFQuery queryWithClassName:@"devices"];
[query whereKeyExists:@"location"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
for (PFObject *row in objects) {
PFGeoPoint *geoPoint = [row objectForKey:@"location"];
CLLocationCoordinate2D coord = { geoPoint.latitude, geoPoint.longitude };
for (id<MKAnnotation> ann in mapView.annotations) {
if ([ann.title isEqualToString:[row objectForKey:@"deviceid"]]) {
[ann setCoordinate:coord];
NSLog(@"latitude is: %f" , coord.latitude);
NSLog(@"Is called");
break;
}
else {
//[self.mapView removeAnnotation:ann];
}
}
}
}
else {
}
}];
}
Run Code Online (Sandbox Code Playgroud) 可能重复:
php中的pack().非法十六进制数字警告
我正在使用apple的推送通知服务,为了发送通知,您必须以二进制格式构建消息.我在下面的行中遇到以下错误:
警告:pack():类型H:非法的十六进制数字r
警告:pack():类型H:非法的十六进制数字y
注意:第130行的C:\ xampp\htdocs\firecom\FireComAPNS.php中的数组到字符串转换
这是抛出错误的代码行:
$msg = chr(0).pack('n', 32).pack('H*', $devicetoken).pack('n',strlen($payload)) . $payload;
Run Code Online (Sandbox Code Playgroud)
和
$devicetoken=773f5436825a7115417d3d1e036da20e806efeef547b7c3fe4da724d97c01b30
Run Code Online (Sandbox Code Playgroud)
我在互联网上搜索了很多,但我不知道如何搞乱二进制文件,任何有关正在发生的事情的帮助将不胜感激!
php binary runtime-error apple-push-notifications devicetoken
我正在尝试设置一个表索引,但它在右侧显示为一个白色条.我正在使用故事板.有谁知道发生了什么?谢谢
码:
#pragma mark - Tableview datasource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections in a tableview
return self.arrayOfCharacters.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return the height of each cell
return 55;
}
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
// Return table index
return [NSArray arrayWithArray: [@"A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|#" componentsSeparatedByString:@"|"]];
}
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
{
// Match the section titls with the sections
NSInteger count = 0;
// Loop through the array of characters …Run Code Online (Sandbox Code Playgroud) 我正在使用mysqli prepare语句来查询具有多个约束的数据库.我在我的测试文件中运行了代码,它运行得很好.但是,当我将代码移动到我的实时文件时,它会抛出以下错误:
PHP警告:mysqli_stmt :: bind_result():绑定变量数与第80行C:\ wamp\www\firecom\firecom.php中预准备语句中的字段数不匹配
PHP注意:未定义的变量:在第89行产生C:\ wamp\www\firecom\firecom.php
两个参数都正确设置,但有些东西正在抛弃它.
码:
$query = $mysqli->prepare("SELECT * FROM calls WHERE wcccanumber = ? && county = ?");
$query->bind_param("ss", $wcccanumber, $county);
$query->execute();
$meta = $query->result_metadata();
while ($field = $meta->fetch_field()) {
$parameters[] = &$row[$field->name];
}
call_user_func_array(array($query, 'bind_result'), $parameters);
while ($query->fetch()) {
foreach($row as $key => $val) {
$x[$key] = $val;
}
$results[] = $x;
}
print_r($results['0']);
Run Code Online (Sandbox Code Playgroud)
$ query var_dump:
object(mysqli_stmt)#27 (10) { ["affected_rows"]=> int(-1) ["insert_id"]=> int(0) ["num_rows"]=> int(0) ["param_count"]=> int(2) ["field_count"]=> int(13) ["errno"]=> int(0) ["error"]=> …Run Code Online (Sandbox Code Playgroud) 在我的地图注释中,我有一个UIButton作为标注中的每个附件视图.在该- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control方法中,如何确定触摸哪个附件视图来处理每个事件?这是我的代码:
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
if ([annotation isKindOfClass:[MKUserLocation class]])
return nil;
MKPinAnnotationView *MyPin=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"current"];
UIButton *calloutButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
UIButton *directionsButton = [UIButton buttonWithType:UIButtonTypeCustom];
directionsButton.frame = CGRectMake(0, 0, 23, 23);
[directionsButton setBackgroundImage:[UIImage imageNamed:@"directions.png"] forState:UIControlStateNormal];
MyPin.leftCalloutAccessoryView = directionsButton;
MyPin.rightCalloutAccessoryView = calloutButton;
MyPin.draggable = NO;
MyPin.highlighted = NO;
MyPin.animatesDrop= YES;
MyPin.canShowCallout = YES;
MyPin.pinColor = MKPinAnnotationColorRed;
return MyPin;
}
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
Annotation *ann = view.annotation; …Run Code Online (Sandbox Code Playgroud) 我正在使用 Parse 提供的电子邮件验证功能,并希望我的用户能够在发送失败或看不到电子邮件验证时重新发送电子邮件验证。最后我看到,Parse 没有提供一种内在的方法来做到这一点(愚蠢),人们一直在半茫然地编写代码来更改电子邮件,然后将其更改回来以触发重新发送。对此是否有任何更新,或者将电子邮件从原始邮件更改回来仍然是唯一的方法吗?谢谢
我正在尝试使用操作表打开带有链接的safari.变量设置正确并相应地显示链接,但由于某种原因,Safari将无法打开,我无法弄清楚为什么...
这是代码:
-(void)actionSheet {
sheet = [[UIActionSheet alloc] initWithTitle:@"Options"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Open in Safari", nil];
[sheet showInView:[UIApplication sharedApplication].keyWindow];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex != -1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:self.url]];
}
}
Run Code Online (Sandbox Code Playgroud) 我想从当前日期开始一个月.
以下是我所拥有的,它正在回归:4027-09-24 16:59:00 +0000.currentDate是对的.这是怎么回事?
// Get todays date to set the monthly subscription expiration date
NSDate *currentDate = [NSDate date];
NSLog(@"Current Date = %@", currentDate);
NSDateComponents *dateComponents = [[NSCalendar currentCalendar] components:NSMonthCalendarUnit | NSDayCalendarUnit | NSYearCalendarUnit fromDate:currentDate];
dateComponents.month = dateComponents.month + 1;
NSDate *currentDatePlus1Month = [[NSCalendar currentCalendar] dateByAddingComponents:dateComponents toDate:currentDate options:0];
NSLog(@"Date = %@", currentDatePlus1Month);
Run Code Online (Sandbox Code Playgroud) 我正在使用AFNetworking下载使用第三方类解析的数据.我曾经多次使用AFNetworking做类似的动作,但出于某种原因,当我调用downloadProgressBlock并进行计算以使用我的进度条时,数字会返回负数.见下文:
2013-09-22 16:04:06.036 Portland Police[2228:60b] Download = -31849.000000
2013-09-22 16:04:06.041 Portland Police[2228:60b] Download = -40537.000000
2013-09-22 16:04:06.042 Portland Police[2228:60b] Download = -44881.000000
2013-09-22 16:04:06.044 Portland Police[2228:60b] Download = -53569.000000
2013-09-22 16:04:06.046 Portland Police[2228:60b] Download = -62257.000000
2013-09-22 16:04:06.048 Portland Police[2228:60b] Download = -63705.000000
2013-09-22 16:04:06.085 Portland Police[2228:60b] Download = -70945.000000
2013-09-22 16:04:06.087 Portland Police[2228:60b] Download = -89769.000000
2013-09-22 16:04:06.089 Portland Police[2228:60b] Download = -94113.000000
2013-09-22 16:04:06.100 Portland Police[2228:60b] Download = -98457.000000
2013-09-22 16:04:06.104 Portland Police[2228:60b] Download = -102801.000000
2013-09-22 16:04:06.111 …Run Code Online (Sandbox Code Playgroud) ios ×7
annotations ×2
mkmapview ×2
php ×2
afnetworking ×1
arrays ×1
binary ×1
build ×1
calendar ×1
callout ×1
date ×1
devicetoken ×1
email ×1
indexing ×1
mkannotation ×1
mysqli ×1
nscalendar ×1
nsdate ×1
openurl ×1
progress-bar ×1
safari ×1
sh ×1
sql ×1
tableview ×1
uibutton ×1
uitableview ×1
verification ×1
xcode ×1