objective-c

AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID

戏子无情 提交于 2021-02-07 12:01:25
问题 xCode 11.6, iOS 11.4, Objective C app. Launching a SFSafariViewController from a UIViewController. My UIViewController is the delegate of the SFSafariViewController. NSString *sURL = [dctData objectForKey:@"URL"]; NSURL *URL = [NSURL URLWithString:sURL]; safari = [[SFSafariViewController alloc] initWithURL:URL]; [_safari setDelegate: self]; [self presentViewController:_safari animated:YES completion:nil]; The delegate method safariViewControllerDidFinish works. I receive the following error

UIAlertAction completion block not called - iOS

只愿长相守 提交于 2021-02-07 11:36:31
问题 I have an iOS app with a UIAlertController in the form of a action sheet being presented in my app when the user taps on a button. It all works great, apart from one thing, the completion blocks don't get called for some reason. Here is my code: // Setup the alert information/type. UIAlertController *action_view = [UIAlertController alertControllerWithTitle:@"Test title" message:@"test message" preferredStyle:UIAlertControllerStyleActionSheet]; // Create and add the cancel button.

How can I get a reference to the current UINavigationController?

℡╲_俬逩灬. 提交于 2021-02-07 11:23:08
问题 In Objective-C, what is the best way of getting a reference to the current UINavigationController? I would like to gain access to it from any class that may not have a reference to a UIController, delegate, or anything else. Is there an existing way to get the current UINavigationController? Should I add something to my application delegate, and retrieve that? 回答1: As it turns out, you can get it, albeit with quite a bit of dot syntax, from any UIView/UIViewController descendant. self.(view)

Whats faster sending multiple small messages or less longer messages with TCP Sockets

你。 提交于 2021-02-07 09:23:15
问题 I can find any documentatin anywhere and would like to know what would be the best method of send multiple messages as fast as possible. for example if I had 300 devices recieivng messages from one server would it be better to send out one big message and have the devices pick out the parts that they need or send 300 messages but at 1/300 of the size. They would only be small stings so the 300 devies would only be getting 6 bytes each Does it make a difference? Thanks in advanced. 回答1: If the

Cannot rotate interface orientation to portrait upside down on iPhone X

偶尔善良 提交于 2021-02-07 07:27:20
问题 We have an app which makes use of an accessory connected to the audio jack(or lightning port in iPhone7 or later).It needs to be run in certain orientations, depending on iOS device. There are currently no issues setting device orientation in either simulator or actual device for any iPhone, except the iPhoneX simulator. Current code for setting orientation: - (BOOL)shouldAutorotate { return YES; } - (UIInterfaceOrientationMask)supportedInterfaceOrientations { //device checks omitted return

Cannot rotate interface orientation to portrait upside down on iPhone X

五迷三道 提交于 2021-02-07 07:27:18
问题 We have an app which makes use of an accessory connected to the audio jack(or lightning port in iPhone7 or later).It needs to be run in certain orientations, depending on iOS device. There are currently no issues setting device orientation in either simulator or actual device for any iPhone, except the iPhoneX simulator. Current code for setting orientation: - (BOOL)shouldAutorotate { return YES; } - (UIInterfaceOrientationMask)supportedInterfaceOrientations { //device checks omitted return

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

NSURLSession didFinishDownloadingToURL temporary downloaded file not found

拟墨画扇 提交于 2021-02-07 05:58:19
问题 I'm having a strange issue with NSURLSession on the delegate method didFinishDownloadingToURL. First thing I'm doing is check if the temporary downloaded file exist: - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location { if (![[NSFileManager defaultManager] fileExistsAtPath: [location path]]) { NSLog(@"Error. File not found"); return; // is giving error when the app is wake up by the system } ... } It