uidevice

Any way to get the name of iPhone user?

南楼画角 提交于 2019-11-30 04:55:51
Outside of asking the user to input their name, is there any way to get it off the device? I tried this library, which attempts to extract the name from [UIDevice currentDevice] name] , but that doesn't work in a lot of situations: https://github.com/tiboll/TLLNameFromDevice Is the user's name present in the phonebook or anywhere else that we have access to in iOS 6? rckoenes Well you could go through all the contacts in the AddressBook and see if any of them are marked with the owner flag. Just be aware that doing this will popup the "this app wants access to the address book" message. Also

Know if iOS device has cellular data capabilities

时间秒杀一切 提交于 2019-11-29 20:10:22
I have a toggle in my app that's "download on WiFi only". However, that toggle is useless for iPod touch or WiFi-iPads. Is there a way to know if the device has cellular data capabilities in code? Something that would work in the future would be great too (like if an iPod touch 5th gen with 3G comes out). bentech Hi you should be able to check if it has the pdp_ip0 interface #import <ifaddrs.h> - (bool) hasCellular { struct ifaddrs * addrs; const struct ifaddrs * cursor; bool found = false; if (getifaddrs(&addrs) == 0) { cursor = addrs; while (cursor != NULL) { NSString *name = [NSString

UIDevice currentDevice's “orientation” always null

戏子无情 提交于 2019-11-29 06:52:04
As per the title. Calling [[UIDevice currentDevice] BeginGeneratingDeviceOrientationNotifications] has no effect. DidRotateToInterfaceOrientation etc events are working fine, but I need to be able to poll the device orientation arbitrarily. How can I fix/do this? The long story: I have a tab application with a navigation controller on each tab. The root view of tab number one is a graph that goes full screen when the orientation changes to landscape; however this needs to be checked whenever the view appears as the orientation change could have occurred elsewhere, so I was hoping to poll the

Any way to get the name of iPhone user?

走远了吗. 提交于 2019-11-29 02:27:28
问题 Outside of asking the user to input their name, is there any way to get it off the device? I tried this library, which attempts to extract the name from [UIDevice currentDevice] name] , but that doesn't work in a lot of situations: https://github.com/tiboll/TLLNameFromDevice Is the user's name present in the phonebook or anywhere else that we have access to in iOS 6? 回答1: Well you could go through all the contacts in the AddressBook and see if any of them are marked with the owner flag. Just

How do I detect orientation on app launch for splash screen animation on iPad!

☆樱花仙子☆ 提交于 2019-11-28 20:35:15
Hi I have an app and I have two *.pngs for default splash screen: Default-Landscape.png Default-Portrait.png What I want is to animate this default splash screen away when my app is loaded and ready to go. To achieve this I would normally present an UIImageView with either default-landscape or default-portrait (depending on the device orientation), keep it on screen for a certain time and then animate it away. My problem is that if I call [[UIDevice currentDevice] orientation] in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { The

Know if iOS device has cellular data capabilities

丶灬走出姿态 提交于 2019-11-28 15:59:13
问题 I have a toggle in my app that's "download on WiFi only". However, that toggle is useless for iPod touch or WiFi-iPads. Is there a way to know if the device has cellular data capabilities in code? Something that would work in the future would be great too (like if an iPod touch 5th gen with 3G comes out). 回答1: Hi you should be able to check if it has the pdp_ip0 interface #import <ifaddrs.h> - (bool) hasCellular { struct ifaddrs * addrs; const struct ifaddrs * cursor; bool found = false; if

UIDevice currentDevice's “orientation” always null

元气小坏坏 提交于 2019-11-28 00:27:08
问题 As per the title. Calling [[UIDevice currentDevice] BeginGeneratingDeviceOrientationNotifications] has no effect. DidRotateToInterfaceOrientation etc events are working fine, but I need to be able to poll the device orientation arbitrarily. How can I fix/do this? The long story: I have a tab application with a navigation controller on each tab. The root view of tab number one is a graph that goes full screen when the orientation changes to landscape; however this needs to be checked whenever

get list of installed applications on iphone objective-c

爷,独闯天下 提交于 2019-11-27 20:18:22
I have an application that needs to get the list of installed (other, maybe third party) applications on the device. How can it be done? Or can it be done at all? rishi I doubt if something is available(if some iphone is jailbreaked and user can access file system, then it will be possible, but i am not aware of this.), but you can use following link and with the help of this you can check what all app are present and you can customize with some of your needs. You could scan all your apps through apple private framework "MobileInstallationInstall". The method is like below: NSDictionary

How do I detect orientation on app launch for splash screen animation on iPad!

前提是你 提交于 2019-11-27 12:59:12
问题 Hi I have an app and I have two *.pngs for default splash screen: Default-Landscape.png Default-Portrait.png What I want is to animate this default splash screen away when my app is loaded and ready to go. To achieve this I would normally present an UIImageView with either default-landscape or default-portrait (depending on the device orientation), keep it on screen for a certain time and then animate it away. My problem is that if I call [[UIDevice currentDevice] orientation] in - (BOOL

How Do I detect the orientation of the device on iOS?

大兔子大兔子 提交于 2019-11-27 03:35:33
I have a question on how to detect the device orientation on iOS. I don't need to receive change notifications, just the current orientation itself. This seems to be a rather simple question, but I haven't been able to wrap my head around it. Below is what I have done so far: UIDevice *myDevice = [UIDevice currentDevice] ; [myDevice beginGeneratingDeviceOrientationNotifications]; UIDeviceOrientation deviceOrientation = myDevice.orientation; BOOL isCurrentlyLandscapeView = UIDeviceOrientationIsLandscape(deviceOrientation); [myDevice endGeneratingDeviceOrientationNotifications]; In my mind this