iphone

Reading a file from a hard drive in iPhone simulator

北慕城南 提交于 2021-02-07 06:46:46
问题 Is it possible to read a file (from my normal file system) into a iPhone App running on the iPhone Simulator? I understand that the iPhone itself has not got a (user accessible) file system but this is simply for testing and will only ever be run in the simulator. The file will be a text file that can be edited while the application is running, it will be read every-time a method is called. 回答1: Yes, you can, and it doesn't matter where it is. Just give it an absolute path name when you load

Auto-renewable subscriptions: How long a month is?

拈花ヽ惹草 提交于 2021-02-07 06:16:05
问题 I got confused about some issues: 1: The one month duration of auto-renewable subscriptions is 30 days or does it depend on a natural month? Because I can only test in sandbox mode,so the duration is just several minutes... Maybe Apple just simply calculates it like this: 2013\01\15 -> 2013\02\15 -> 2013\03\15. If so,the second issue comes up 2: For example: I buy a monthly auto-renewable subscriptions at 2013\03\31 ,because 2013\04 only has 30 days, then what is the expires_date of my

Auto-renewable subscriptions: How long a month is?

这一生的挚爱 提交于 2021-02-07 06:11:40
问题 I got confused about some issues: 1: The one month duration of auto-renewable subscriptions is 30 days or does it depend on a natural month? Because I can only test in sandbox mode,so the duration is just several minutes... Maybe Apple just simply calculates it like this: 2013\01\15 -> 2013\02\15 -> 2013\03\15. If so,the second issue comes up 2: For example: I buy a monthly auto-renewable subscriptions at 2013\03\31 ,because 2013\04 only has 30 days, then what is the expires_date of my

How to determine height of the toolbar in UINavigationController?

杀马特。学长 韩版系。学妹 提交于 2021-02-07 05:27:25
问题 I have a view with a toolbar presented by a UINavigationController. When I am handling UIKeyboardWillShowNotification, I'm scrolling the entire screen upwards by the height of the keyboard. The thing is when the keyboard is shown, the bottom toolbar is not, so I need to scroll the screen upwards by only (keyboard.height - toolbar.height). But how to get the height of the toolbar? Thanks 回答1: You just should check the toolbar frame. self.navigationController.toolbar.frame.size.height Of course

Call a method from AppDelegate - Objective-C

二次信任 提交于 2021-02-07 05:16:32
问题 I was trying to call an existing method of my ViewController.m from AppDelegate.m inside the applicationDidEnterBackground method, so I found this link: Calling UIViewController method from app delegate, which told me to implement this code: In my ViewController.m -(void)viewDidLoad { [super viewDidLoad]; AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; appDelegate.myViewController = self; } In my AppDelegate: @class MyViewController; @interface AppDelegate :

How do I detect iPhone on network?

人盡茶涼 提交于 2021-02-07 05:14:52
问题 I am trying to detect if my iPhone is in the same network as my Raspberry Pi. I would like to execute a script when I am at home and my iPhone's presence is registered in my LAN. It seems that when the phone is in standby not even the iphone-sync port (6207/tcp) is found. "/usr/bin/nmap -n -sT -p62078 [my phone's local IP]" shows no host. I wonder what else I could scan for. Obviously the phone is online and ready to accept facetime calls (data via 3G is deactivated). Could I accomplish

How do I detect iPhone on network?

旧街凉风 提交于 2021-02-07 05:11:07
问题 I am trying to detect if my iPhone is in the same network as my Raspberry Pi. I would like to execute a script when I am at home and my iPhone's presence is registered in my LAN. It seems that when the phone is in standby not even the iphone-sync port (6207/tcp) is found. "/usr/bin/nmap -n -sT -p62078 [my phone's local IP]" shows no host. I wonder what else I could scan for. Obviously the phone is online and ready to accept facetime calls (data via 3G is deactivated). Could I accomplish

How to make Horizontal scrollView and some buttons in it (programming)

橙三吉。 提交于 2021-02-07 04:10:58
问题 sorry,I have a problem.I don't use storyBoard. I want to make a view like this. photo by terenceLuffy/AppStoreStyleHorizontalScrollView but I try to do this. Finlly,scrollView just show last button like this. This is code: var scView:UIScrollView = UIScrollView() var buttonPadding:CGFloat = 10 var xOffset:CGFloat = 10 scView.backgroundColor = UIColor.blue scView.translatesAutoresizingMaskIntoConstraints = false func viewDidLoad() { for i in 0 ... 10 { let button = UIButton() button.tag = i

How to make Horizontal scrollView and some buttons in it (programming)

可紊 提交于 2021-02-07 04:10:34
问题 sorry,I have a problem.I don't use storyBoard. I want to make a view like this. photo by terenceLuffy/AppStoreStyleHorizontalScrollView but I try to do this. Finlly,scrollView just show last button like this. This is code: var scView:UIScrollView = UIScrollView() var buttonPadding:CGFloat = 10 var xOffset:CGFloat = 10 scView.backgroundColor = UIColor.blue scView.translatesAutoresizingMaskIntoConstraints = false func viewDidLoad() { for i in 0 ... 10 { let button = UIButton() button.tag = i

Growl type notification on iPad/iPhone?

亡梦爱人 提交于 2021-02-07 03:48:42
问题 Growl type notification on iPad/iPhone? I want to show a non-modal/non-popup notification on top of an iPad application. Growl's are a Mac OS X program that show little popup windows in the corner of the screen that dissappear after an amount of time or have a little x on them (to close sooner.) 回答1: Here is a tutorial for a sliding view. 回答2: A custom UIView I created GCDiscreetNotificationView will setup this pretty easily. 来源: https://stackoverflow.com/questions/4754876/growl-type