Set some logic , like check , if network is connected to Wifi or Cellular-data , and then set your code in cellular data.
Reachability *reachability = [Reachability reachabilityForInternetConnection];
[reachability startNotifier];
NetworkStatus status = [reachability currentReachabilityStatus];
if(status == NotReachable)
{
//No internet
}
else if (status == ReachableViaWiFi)
{
//WiFi
}
else if (status == ReachableViaWWAN)
{
//3G // Set your code here for cellular data
}
Find more detail on ios-detect-3g-or-wifi set according to your requirement.
Note :- I think when your iPhone is connected with wifi then it lefts cellular data automatically and if disconnect wifi then again connected with cellular data
Edit :- I am not sure but try this ,
if(status == NotReachable)
{
//No internet
}
else if (status == ReachableViaWWAN)
{
//3G // Set your code here for cellular data
if (status == ReachableViaWiFi)
{
//WiFi // Keep Wifi and cellulardata both on.
}
}
else if (status == ReachableViaWiFi)
{
//WiFi
}
else if (status == ReachableViaWWAN)
{
// keep status only cellularadat on
}