AddressBookExternalChangeCallback not call with iPhone 5 iOS 7 - iphone

My app load contacts from the native contacts on my iPhone, into my app when I edit contact I use the follow function to refresh contacts, and the action edit can update into contacts list of my app.
void AddressBookExternalChangeCallback (
ABAddressBookRef addressBook,
CFDictionaryRef info,
void *context
)
{
[(__bridge ContactsManager*)context refreshContacts];
}
The problem is this function had NOT CALL when I run on iPhone 5(iOS 7) device. However, with iOS 7 on iPod touch or iPhone 4s this function had call. Please help me to find out the root cause. Thanks in advance.

Related

App works on simulator but not on ipod touch

I have developed an app, which imports contacts into Addressbook. The app works great on simulator, but when i tested on my ipod touch, it does not work correctly. It does not crash, but instead it give the wrong result.I have no idea what's wrong with it. Here is the code i think it works on simulator but not on ipod touch.
CFErrorRef couldAddPersonError = NULL;
BOOL couldAddPerson = ABAddressBookAddRecord(addressBook,
person,
&couldAddPersonError);
CFErrorRef couldSaveAddressBookError = NULL;
BOOL couldSaveAddressBook = ABAddressBookSave(addressBook,
&couldSaveAddressBookError);
Thanks in advance

iOS5 CMMotionManager startDeviceMotionUpdatesToQueue: fails on iPhone3GS

I have a software-hardware related issue that I'm trying to troubleshoot. My app was developed for iPhone4, iOS5 and uses Core Motion framework to process accelerometer and gyroscope data in real time. The app fails when running on iPhone 3GS with iOS5
My main core-motion method looks like this:
[motionManager startDeviceMotionUpdatesToQueue:motionQueue withHandler:^(CMDeviceMotion *motion, NSError *error) {
//notify calibration delegate
if(calibrationDelegate)
{
[calibrationDelegate collectCalibrationMotionData:motion];
}
//a lot more processing
}
I have reports that iPhone3GS does not return yes to isGyroAvailable, while iPhone4 returns yes.
BOOL accelerometerAvailable = (motionManager.isAccelerometerAvailable)?YES:NO;
BOOL gyroscopeAvailable = (motionManager.isGyroAvailable)?YES:NO;
if(!accelerometerAvailable && ! gyroscopeAvailable)
{
//handle error
remoteControlState = kRemoteControlStateError;
}
I've painfully discovered that Apple sells my app to customers with iPhone4, 4s AND 3GS. The app does not work for customers with iPhone 3GS because the call above does not seem to pass the motion objects to the calibration delegate.
I do not have iPhone 3GS to test the app on, so I have a few questions:
Is it possible to specify anywhere in the XCode project properties
that I want my app to run ONLY on iPhone4 and above? (or devices with gyroscope available?)
Where can I find more information on iOS5 quirks like the one above
to better understand how iPhone3GS differs from iPhone4?
Is it possible to specify anywhere in the XCode project properties that I want my app to run ONLY on iPhone4 and above? (or devices with gyroscope available?)
Yes, you would specify such dependencies in the UIRequiredDeviceCapabilities key of your Info.plist (gyroscope would be the requirement in this case).
However, for a released app, it's unfortunately impossible to add new requirements.

Application Platform Specification

I am designing an app for iphone & ipod the client wants the Some of the UI Specification for iphone and ipod to be different so i decided to create different XIB Files for iphone and ipod as in universal apps for iphone and ipod but the problem is that i am not able differentiate between iphone and ipod on run time is there any way to check platform on runtime so as to load different Nib Files on runtime
If there is any code or tutorial please guide me to the link
Thanks in advance
[[UIDevice currentDevice] model] looks like the right source for this Information. You can check it if it contains iPod Touch or iPhone or.....
Check the model property of UIDevice class
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html
However, if you switch on that string, be aware that the simulator shows up as a separate device.
This:
NSString* model = [[UIDevice currentDevice] model];
NSLog(#"model: %#", model);
Outputs:
2011-10-25 08:44:30.794 Craplet[921:b303] model: iPhone Simulator
I think this was already asked several times .)
NSString *dtype = [UIDevice currentDevice].model;
if([dtype isEqualToString:#"iPhone"])
{
// iphone
}
Possible examples of model strings are #”iPhone” and #”iPod touch”

Apple gamecenter available test returns YES on iphone 3g

I'm making a game with gamecenter support. I want to diable a button for iPhone 3g or older devices. But my 3g test device says, that gamecenter is available and the matchmaking view show up. The user will never get authenticated. I use the snippet from apple to check, if gamecenter is available. It should return NO on devices older than 3gs
-(BOOL)isGameCenterAvailable {
// check for presence of GKLocalPlayer API
Class gcClass = (NSClassFromString(#"GKLocalPlayer"));
// check if the device is running iOS 4.1 or later
NSString *reqSysVer = #"4.1";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
BOOL osVersionSupported = ([currSysVer compare:reqSysVer
options:NSNumericSearch] != NSOrderedAscending);
return (gcClass && osVersionSupported); }
Does anyone do it better than apple?
Apparently, there is more to detecting Game Center support than just checking for the existence of the API. According to Optionally Supporting Game Center In Your Game, in addition to checking for the APIs you'll also need to authenticate the player:
iOS 4.1 may be installed on some
devices that do not support Game
Center. On those devices, the
isGameCenterAPIAvailable function
defined Listing 1-1 still returns YES.
The next step in confirming whether
Game Center may be used on the device
is to attempt to authenticate the
local player; on devices that do not
support game center, your game
receives a GKErrorNotSupported error.

uitextview refreshing when using image picker or take a new photo iphone device?

Hello good morning everyone, i am having a weird issue when using imagePickerController. Actually i have a view with 2 uitextviews. the user input some text and then take a option to add a photo with the text in the uitextviews to be sent. i select attach photo from there either i take a new photo using camera or i select from library , once selected the imagePickerController disappears BUT here i have 2 situation with 3 actual devices i tested :
Iphone 3G IOS 4.2.1 > ok the text i input earlier is still on the view.
IPhone 3GS IOS 4.3 > the text dissappears
iPhone 3GS another device IOS 4.3 > the text remains.
Is this a memory issue or a bug somewhere?
Many thanks :)
Just in case If you get a proper solution for this then let me know because I faced the same problem. For the time being I save all the content in a dictionary prior to presenting the Picker. Once the Picker is dismissed I fill The details back in viewWillAppear: method. I am still looking for a standard approach to resolve this issues.
-(void)viewWillAppear:(BOOL)animated{
  if (!registrationDataDict)
{
registrationDataDict = [[NSMutableDictionary alloc] initWithCapacity:0];
}
else {
if (![registrationDataDict valueForKeyIsNull:#"USER_NAME"])
{
[UserNameTexeFied setText:[registrationDataDict valueForKey:#"USER_NAME"]];
}
if (![registrationDataDict valueForKeyIsNull:#"FIRST_NAME"])
{
[FNameTextFied setText:[registrationDataDict valueForKey:#"FIRST_NAME"]];
}
if (![registrationDataDict valueForKeyIsNull:#"LAST_NAME"])
{
[LNameTextFied setText:[registrationDataDict valueForKey:#"LAST_NAME"]];
}
}
Cheers
I would say this is a bug somewhere in your code. The reason is, there are some differences in ios 4.3 and 4.2. I can trace the bug if you post your code.
Cheers!