xcode7

List the Versions of all the applications installed in iOS device programmatically

女生的网名这么多〃 提交于 2019-12-12 10:01:49
问题 I need to get the Versions of all the installed applications programmatically for non-jailbroken iOS devices. Is it Possible to achieve this? 回答1: That's possible, please try the below code. Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace"); NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)]; for (LSApplicationProxy *apps in [workspace performSelector:@selector(allApplications)]) { NSString *localizedName = apps

CocoaPods - build for iOS 9 / Swift 2 with Xcode-beta

雨燕双飞 提交于 2019-12-12 08:32:59
问题 I have a "CocoaPod" (terminology?) that's currently at version 1.1. There's also a develop branch of the repo that requires Swift 2.0 (so needs a base SDK of IOS 9.0) with a PodSpec as follows: Pod::Spec.new do |s| s.name = 'ReachabilitySwift' s.version = '2.0-beta1' s.homepage = 'https://github.com/ashleymills/Reachability.swift' s.authors = { 'Ashley Mills' => 'ashleymills@mac.com' } s.summary = 'Replacement for Apple\'s Reachability re-written in Swift with callbacks.' s.license = { :type

Is it possible to stub HTTP requests in Xcode 7 automated UI tests?

点点圈 提交于 2019-12-12 07:36:50
问题 I've been trying to intercept and stub/mock HTTP requests in Xcode 7 automated UI tests, using tools like OHHTTPStubs, with no luck. Here's an example of how I am trying to capture any HTTP request using OHHTTPStubs in the setUp method of a UI test file: override func setUp() { super.setUp() let matcher: OHHTTPStubsTestBlock = { (request) -> Bool in return true } OHHTTPStubs.stubRequestsPassingTest(matcher) { (response) -> OHHTTPStubsResponse! in return OHHTTPStubsResponse.init() } } Is there

How to fix the excess memory being used in mapKit Ios ?

我怕爱的太早我们不能终老 提交于 2019-12-12 05:53:59
问题 Im using a mapKit , drag dropped it from story board. initially the memory use is 30.3mb but as soon as the map is loaded it jumps to 150 and stars increases to as much as 500mb .I tried implementing the hotFix mentioned. - (void)applyMapViewMemoryHotFix{ switch (self.mkMapView.mapType) { case MKMapTypeHybrid: { self.mkMapView.mapType = MKMapTypeStandard; } break; case MKMapTypeStandard: { self.mkMapView.mapType = MKMapTypeHybrid; } break; default: break; } [self.mkMapView removeFromSuperview

XCode7 UITesting - how to add main target classes to be available from UITestCase (Undefined symbols error)?

落爺英雄遲暮 提交于 2019-12-12 05:16:30
问题 I'm doing UI testing with XCode7 and need a way to reset my app to some initial state. I have a method to do so in one of my .m files that are part of the main target. How can I make classes from the main target to be available from within a UITestCase? I tried regular import, but get a linker error: #import <XCTest/XCTest.h> #import "CertificateManager.h" @interface UITests : XCTestCase @end -(void)testWelcomeScreen { //put the app into initial state [[CertificateManager sharedInstance]

XCTest UI Record and Play - Simulator not updating UI

。_饼干妹妹 提交于 2019-12-12 04:24:20
问题 Apple released a new UI Testing framework 2 days ago during WWDC2015. I'm trying to write a test case and when I try to record the UI testing, to generate the scaffolding code, it looks the code is being generated, however the UI on the simulator is not actually updating. i.e When I tap on a button, the code is generated to actually find the button and tap, but the button is not actually tapped simultaneously on the simulator. So basically I'm not able to go to the next screen on the

How to add a custom UIView programmatically with Swift and see it in Interface Builder

与世无争的帅哥 提交于 2019-12-12 04:16:15
问题 I'm trying to add a UserView with controller to a view with Xcode 7 / Swift 2.0. I was not able to figure out how to do this using Interface Builder, instead I added a NSView as a placeholder view and then add the view in code. Is it possible to do it with the Interface Builder? In the image, the orange is the place holder and the green is the user view: When adding the view in code, I assume I have to add the constraints. I tried to use the constraintsWithVisualFormat like below, but when I

How to countdown timer on hours and mins and stop when it's 0 , objective c

妖精的绣舞 提交于 2019-12-12 04:15:54
问题 viewdidload { NSDateFormatter *df = [[[NSDateFormatter alloc] init] init]; [df setDateFormat:@"HH:mm:ss"]; ctime=([df stringFromDate:[NSDate date]]); NSDate *date1 = [df dateFromString:@"12:44"];` NSDate *date2 = [df dateFromString:@"20:50"]; NSTimeInterval interval = [date2 timeIntervalSinceDate:date1]; int hours = (int)interval / 3600; // integer division to get the hours part int minutes = (interval - (hours*3600)) / 60; // interval minus hours part (in seconds) divided by 60 yields

How to share text of a label from iPhone app to facebook?

橙三吉。 提交于 2019-12-12 03:44:41
问题 I have written a simple Xcode project in swift for my iPhone . I am trying to send the text of my label to facebook using facebook share option . Below is my code import UIKit import Social class ViewController: UIViewController { @IBOutlet weak var musicDescription: UILabel! override func viewDidLoad() { super.viewDidLoad() } @IBAction func faceBookShareButton(sender: UIButton) { if SLComposeViewController.isAvailableForServiceType(SLServiceTypeFacebook) { let fbShare:SLComposeViewController

Troubleshooting Submitting Watch App to App Store - Code Signing

三世轮回 提交于 2019-12-12 03:37:49
问题 I'd appreciate if anyone can help me with any or all of my errors I'm getting from trying to upload my new Watch App to the App Store (I already have a current iOS app). First I've followed this tutorial pretty close : Submitting Apple Watch Apps and it seems I'm getting hung up on a lot of code signing and plist problems. So for the first one I don't understand how I would have 2 extensions like this screenshot: The #2 error I've fixed, so I don't know why its still showing. #3 I don't know