与iBeacon及其背景能力相关的SO问题数量正在增加,并且在这一点上存在一些混淆.我一直在测试AirLocate项目.
iBeacon有2个"能力":区域监控和测距.
区域监控仅限于20个区域,可以在后台(监听设备)运行,并有不同的代表通知该区域的进入/退出的听力应用程序(和用户) - 即使应用程序在后台或手机已锁定.
测距仅在前台工作,但会返回(到听音设备)所有iBeacons及其属性(UUID等等)的数组(无限制?)
此外,20个区域监控是设备限制.如果用户正在使用地理围栏提醒,则使用区域监控的其他应用程序; 这会降低这个数字.
那么我们是否说我不能部署一个商城范围内的(100商店+)应用程序,该应用程序使用商店iBeacons向用户发送"特定于商店"的通知,而应用程序在后台或手机被锁定?
我认为广告设备(信标)也必须在前台,以宣传听音设备可以"进入"的区域.我们也这样说,如果商店的所有者拥有iOS设备; 我不能通过要求他使用他的iPhone(至少在早期)作为广告设备(信标)来节省他的钱 - 因为应用程序很可能并不总是在前台?
因此,在iBeacon + MLB的情况下,单个UUID(或<20 UUID)用于应用程序可能确定入口门,然后将要求用户解锁手机/将应用程序带到前台用它(找座位等)?
然后我可以调用iBeacon:单个位置/事件(商店,公园等)功能需要用户最"前景"的注意力才能拥有"完整"的实际用例吗?
我试图阐明用户案例以使其实用化.请回复多于是或否.
我正在尝试检测三种动作:当用户开始步行,慢跑或跑步时.然后我想知道何时停止.我成功地检测到有人在走路,慢跑或跑步时使用以下代码:
- (void)update:(CMAccelerometerData *)accelData {
[(id) self setAcceleration:accelData.acceleration];
NSTimeInterval secondsSinceLastUpdate = -([self.lastUpdateTime timeIntervalSinceNow]);
if (labs(_acceleration.x) >= 0.10000) {
NSLog(@"walking: %f",_acceleration.x);
}
else if (labs(_acceleration.x) > 2.0) {
NSLog(@"jogging: %f",_acceleration.x);
}
else if (labs(_acceleration.x) > 4.0) {
NSLog(@"sprinting: %f",_acceleration.x);
}
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是双重的:
1)每次有动作时都会多次调用更新,这可能是因为它经常检查当用户开始行走时(即_acceleration.x> = .1000)它再次调用更新时仍然> = .1000.
示例日志:
2014-02-22 12:14:20.728 myApp[5039:60b] walking: 1.029846
2014-02-22 12:14:20.748 myApp[5039:60b] walking: 1.071777
2014-02-22 12:14:20.768 myApp[5039:60b] walking: 1.067749
Run Code Online (Sandbox Code Playgroud)
2)我很难弄清楚如何检测用户何时停止.有没有人就如何实施"停止检测"提出建议
代码库越来越大.决定在GIT变得更好......
我正在使用xCode并决定从xcode git转移到SourceTree.我将我的代码保存在我的机器本地但是想进入git flow习惯.我打开了Sourcetree并导入了我的项目.一切看起来都不错
我做了最后的提交并初始化了GitFlow.但是当我从Master分支转移到Development Branch到创建Feature Branches时,我在日志中看到了分支名称,但是我看不到并行的gitflow彩色线条.是因为我的项目是本地的,我没有做任何推/拉?或者我错过了一个设置?
PS:使用xcode 5.不确定是否相关.
我有一个非常简单的应用程序示例,初始化和更新用户位置..在设备上它成功地每隔一秒左右抛出另一个回调位置但是在设备上(运行iOS7的iPhone)调用该方法一次然后神秘地停止...
//Setup Location Manager in ViewDidLoad
locationManager = [[CLLocationManager alloc] init];
[locationManager setDistanceFilter:kCLDistanceFilterNone];
[locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[locationManager setDelegate:self];
[locationManager startUpdatingLocation];
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
NSLog(@"location services not turned on");
}
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
NSLog(@"loactions %@", locations);
}
-(void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"new location %f, and old %f", newLocation.coordinate.latitude, newLocation.coordinate.longitude);
}
Run Code Online (Sandbox Code Playgroud)
在iOS6中,这个应用程序完美无缺地更新了设备位置...自iOS7以来发生了哪些变化?
这是希望它是一个简单的设置.
我不能在IB中输入带小数的约束值.每当我输入一个带小数的值并按下回车键时,系统会将其舍入!
在代码中创建约束时我没有这个问题.只在IB.
有办法吗?
我试图在AVFoundation输出上找到可接受的格式:
self.theOutput=[[AVCaptureVideoDataOutput alloc]init];
if ([self.theSession canAddOutput:self.theOutput])
[self.theSession addOutput:self.theOutput];
Run Code Online (Sandbox Code Playgroud)
然后我在之后插入断点并且:
po [self.theOutput availableVideoCVPixelFormatTypes]
Run Code Online (Sandbox Code Playgroud)
我明白了
(NSArray *) $5 = 0x2087ad00 <__NSArrayM 0x2087ad00>(
875704438,
875704422,
1111970369
)
Run Code Online (Sandbox Code Playgroud)
如何获取这些格式类型的字符串值?
谢谢
nsstring ios avcapture avcapturesession avcapturemoviefileoutput
我正在通过2011年斯坦福秋季iOS课程:http: //www.stanford.edu/class/cs193p/cgi-bin/drupal/
我到作业#3: http://www.stanford.edu/class/cs193p/cgi-bin/drupal/system/files/assignments/Assignment%203_2.pdf
作为总结,先前的任务已经要求建立一个常规计算器,现在这个任务要求我们将这个计算器推送到一个Nav控制器并从该CalculatorViewController创建一个segue到GraphViewController,它将绘制存储在"CalculatorBrain"中的函数.这个CalculatorBrain是原始CalculatorViewController的模型.
提示#5继续谈论的事实是,现在GraphViewController的模型与CalculatorViewController的模型不同,我无法弄清楚他的意思.
我能够构建新MVC的唯一方法是在GraphViewController的GraphView(视图)中创建一个带有ID类型为"dataSource"的对象的协议.然后在GraphViewController中:采用该协议,实例化GraphView并将自身设置为数据源:
-(void) setGraphView:(GraphView *)graphView
{
_graphView=graphView;
self.graphView.dataSource=self;
}
Run Code Online (Sandbox Code Playgroud)
然后在原始的CalculatoViewController中,使用prepareForSegue将程序传递给GraphViewController:
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([segue.identifier isEqualToString:@"Graph"])
{
GraphViewController *myGraphViewController = segue.destinationViewController;
myGraphViewController.myCalculator=self.myCalcBrain;
}
}
Run Code Online (Sandbox Code Playgroud)
所以这似乎工作正常.所以,如果这样做,那意味着GraphViewController的模型真的是原来的计算器大脑,他特别说它不是!
我的意思是,在segue期间,我将从原始的CalculatorViewController分配给Graphviewcontroller计算器属性计算器模型实例,然后使用协议将GraphViewController中的Y值返回到GraphView意味着该模型GraphViewController实际上只是原始的CalculatorBrain模型.
我正在使用iOS 5.1和带有iOS 6.0的iPad 4测试iPhone 4上的应用程序.我环顾四周,出乎意料地没有找到类似的问题:
1 - 我的应用程序有一些已经在iOS的6.0被弃用的方法,所以我相信我有建立一些的if/then条件测试使用的系统版本:[的UIDevice currentDevice] systemVersion],然后使用版本适当的方法.这是最有效的方式吗?
2-我的理解是,只有一个目标,"项目"部署目标和"目标"部署目标服务于同一目的.我需要将其中一个或两个作为iOS 5.1,因为这是iOS支持的最低要求.令人困惑的是,如果目标是基于iOS 5.1构建的,它将如何在iOS4的iPad4上运行:
iPad OS是在运行之前检查目标版本还是只是尝试运行代码,而且iOS 5.1目标没有任何与6.0不兼容的代码?
即使是这种情况,5.1目标如何支持我为有条件地替换弃用方法而构建的6.0方法?
非常感谢!
我被邀请作为团队成员加入开发者帐户.我需要通过testflight向他们发送一个演示应用程序.我检查了应用程序ID列表,并没有为此目的创建应用程序.我也无法创建一个,因为我只有"团队成员权利".我能做的是下载一个开发类型的IOS Team Provisioning Profile,它是用app id:Xcode IOS Wildcard App ID(*)创建的.一切都很好,但当我从X-Code中选择我所属的团队时,它会告诉我"没有找到代码签名身份".如果我按下修复问题,我收到消息"您的帐户已经有一个有效的证书",我可以撤销并请求新的.
我该怎么办?通配符配置文件是否是创建存档的可行选项?我撤销签名身份并申请新身份是什么意思?开发者帐户所有者是否需要专门为我创建新证书?或者我不明白它是什么?签名身份是否与开发者帐户相关?或者我会自动收到一个新的?任何人都可以解释一下细节,以便我理解得当吗?
我正在学习核心动画并尝试示例.
当我使用以下代码时,动画持续时间有效
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
//Modifying base layer
self.view.layer.backgroundColor = [UIColor orangeColor].CGColor;
self.view.layer.cornerRadius = 20.0;
self.view.layer.frame = CGRectInset(self.view.layer.frame, 20, 20);
//Adding layer
mylayer=[CALayer layer]; //mylayer declared in .h file
mylayer.bounds=CGRectMake(0, 0, 100, 100);
mylayer.position=CGPointMake(100, 100); //In parent coordinate
mylayer.backgroundColor=[UIColor redColor].CGColor;
mylayer.contents=(id) [UIImage imageNamed:@"glasses"].CGImage;
[self.view.layer addSublayer:mylayer];
}
- (IBAction)Animate //Simple UIButton
{
[CATransaction begin];
// change the animation duration to 2 seconds
[CATransaction setValue:[NSNumber numberWithFloat:2.0f] forKey:kCATransactionAnimationDuration];
mylayer.position=CGPointMake(200.0,200.0);
mylayer.zPosition=50.0;
mylayer.opacity=0.5;
[CATransaction commit];
}
@end
Run Code Online (Sandbox Code Playgroud)
另一方面,如果我将Animate方法代码集中在ViewDidLoad按钮的底部,以便在不按任何按钮的情况下发生,则不会遵守动画持续时间.我只看到没有任何动画的最终结果.
有什么想法吗?
谢谢九巴
ios ×6
objective-c ×3
ios7 ×2
apple-m7 ×1
autolayout ×1
avcapture ×1
build ×1
calayer ×1
certificate ×1
core-motion ×1
cs193p ×1
deprecated ×1
git ×1
git-flow ×1
ibeacon ×1
nsstring ×1
opengl-es ×1
provisioning ×1
signing ×1
storyboard ×1
target ×1
viewdidload ×1
xcode ×1