Q:

Popping System Alert on UISwitch's 'ON' state

I am new to this and this is my first question.
Would any one let me know whether we can or cannot pop a System Alert on UISwitch's 'ON' state.
I Know we can have custom alert but i don't want that.It is related to GPS whereby when the user switches on the switch it should give you an System Alert asking to on your GPS.

A:

No, it's automatically displayed when the app accesses Core Location. If the user rejects it, it's displayed a second time at the next launch, then it keeps quiet and is not shown anymore.
So there is no way you could force this dialog to show again. iOS will ask the user again on the next start-up of the app.
Edit : If you need to show an alert for GPS you van check whether GPS is enabled or not as if userlocation is nil or not. if it is not nil then set your switch enabled else set disbled. 
MKUserLocation *userLocation = mapView.userLocation;

if (!userLocation.location) 
{
 // Show an alert here to turn on Location service
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Location Service Disabled" 
                                                    message:@"To re-enable, please go to Settings and turn on Location Service for this app." 
                                                   delegate:nil 
                                          cancelButtonTitle:@"OK" 
                                          otherButtonTitles:nil];
    [alert show];
}

So user can enable GPS in settings directly.
Hope it helps you.

