LAContext and iOS7 - ios7

Will this code:
[LAContext class]
crash or return nil on a device that has the Touch ID sensor but is not running iOS8. (iPhone 5s is one such device.)
I'm trying to find such a device to test on but can't find one!
Note, that returns nil in the simulator.

This does not crash under iOS7. (Phew...)

Related

MKMapView crash on iPod when Re-enter in view

I use MKMapView it works fine on iPhone, iPad and simulators but in iPod it crash when i second time enter in the view(first time it work fine). I have tried this but it is not work for me:
-(void) backButtonAction
{
[_mapView setDelegate:nil];
[self.navigationController popViewControllerAnimated:YES];
}
When I try to execute the code on an iPod(go second time on view) .I get an error ( EXC_BAD_ACCESS(code=EXC_ARM_DA_ALIGN,address=0x494f6055) )
By this solution didUpdateUserLocation method is not called and you are not able to get user location internally from didUpdateUserLocation method but until Apple not fixes it.This is the only solution i got from the link EXC_BAD_ACCESS at lauch for EAGLContext renderbufferStorage: fromDrawable: in Cocos2d app whie debugging
which i do and remove the crash.
In Xcode, go to Product -> Scheme -> Edit Scheme ... And for the Run Debug configuration (on left side) choose "Options" (on right side) and configure "GPU Frame Capture" as Disabled.

geofence didEnterRegion not works propertly

I try to test geofencing in iOS 7, but dont works propertly.
This is my code: http://pastebin.com/rCg5xUyT
The problem are when I add a CLCircularRegion (radius: 100m) to CLLocationManager, I show UIAlertView when didEnterRegion, but the UIAlertView shows on 1950m, I dont understand why.
I test on simulator, using Debug > Location > Freeway drive
I test too on my iPhone 5, but don't works propertly, the UIAlertView shows when distance from my current location are more than 1950m.
Somebody can help me please ?
Thanks.

Xcode iOS: Calling a number from the app

I across the following code:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://8005551212"]];
on : Making phone calls on iPhone
But, it does not work for me in the simulator.
I have connected the IBAction(callphone) to the ViewController(TouchUpInside). I am now not sure, is it because I am checking my code in simulator? I do not get a dialog box. Please advice.
I tried putting log statements and the action does get called since the log stamtments that I wrote to test is being printed
Can you make a phone call from your Mac? No. That's why the simulator doesn't work when you try to open a tel:// URL. You must do this from a device that can make a call: an iPhone, but not an iPad or iPod touch.

EAAcessory errors while closing session with iOS 6.0 GM

There is a MFI device that is connected to iPhone 4S (6.0 GM) or to iPad (6.0 GM) via Bluetooth (2.1 + EDR). The project was built on Xcode 4.5 GM. When the app gets EAAccessoryDidDisconnectNotification it will send message [_eaSessionController closeSession];. All these worked nice in iOS 5.1.1 or earler. But on iOS6 with this message I got logs as follows:
-[NSCondition dealloc]: condition (<NSCondition: 0x2e5640> '(null)') deallocated while still in use
Break on _NSLockError() to debug.
Any ideas?
I came across the same issue. This warning is thrown when calling [NSStream close] upon receiving an EAAccessoryDidDisconnectNotification. There should be also some data exchange between the two devices just before the disconnection.
Breaking on _NSLockError will show that at the moment the object is deallocated, some of the threads spawned by the external accessory framework are waiting on conditions. One of those certainly waits on the condition that is being freed, which explains the warning thrown on the console.
I also noticed that the number of threads created by the external accessory framework keeps on growing each time the accessory disconnects then connects, and they seem to be just leaking.
It seems to me that somehow, the external accessory framework does not properly free the resources it allocates, which results in a lot of mess. One of the subsequent effects of this are crashes that happen inside one of those leaked threads during a call to OSAtomicCompareAndSwap64.
I managed to reproduce the issue using a basic sample in which the streams are scheduled on the main thread to avoid any thread management inside the application. I believe it's an accessory management bug on iOS 6 that Apple should be aware of. I'll report it and wait for what they have to say.
Meanwhile, I wonder if anyone of you guys has managed to make any progress on this.
Thanks,
There is no such trouble in iOS 6.1+. To fix this for iOS 6.0 and iOS 6.0.1 please use next solution:
Please note: this is only temp solution allow your users with iOS 6.0 and 6.0.1 continue use your app.
There is a simple hack to avoid application crashes: just create new category and override dealloc method (NSCondition) for iOS 6.0 and iOS 6.0.1:
#import "NSCondition+LeakDealloc.h"
#import <objc/runtime.h>
#implementation NSCondition (LeakDealloc)
- (void) safeDealloc
{
float sVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
if (sVersion < 6.0 || sVersion >= 6.1)
{
[self safeDealloc];
}
}
+ (void) load
{
method_exchangeImplementations(class_getInstanceMethod(self, #selector(dealloc)), class_getInstanceMethod(self, #selector(safeDealloc)));
}
#end
This solution make new leak, after 20 min tests and about 50 BG/FG swithces instruments shows 10 NSCondition leaks (960 Bytes), BUT no one crash!
The issue has been fixed in iOS 6.1.
There are no more leaking NSCondition or external accessory threads. Apple seem to having fixed the issue properly.

How do you programmatically detect your iPad's generation?

I'm working on a program that needs to be able to detect whether or not camera hardware is present in the iPad. I assumed that the easiest way to do this was to determine what generation the device was, but if there is a simpler way to detect the hardware that works too. The iPads that this application is being designed for will likely be recently purchased and running on a standard updated version of iOS.
Nope You can simply check what device is being used!
For checking all iOS devices:
NSString *deviceType = [UIDevice currentDevice].model;
NSLog(deviceType);
In order to check for a camera
if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera])
//there is a camera