Affichage des articles dont le libellé est Active questions tagged xcode - Stack Overflow. Afficher tous les articles
Affichage des articles dont le libellé est Active questions tagged xcode - Stack Overflow. Afficher tous les articles

dimanche 10 mai 2015

Debug on Apple Watch: Error Launching 'xxx WatchKit Extension' - Couldn’t communicate with a helper application

I am trying to debug on my apple watch (real device, not simulator). My main project runs on my iPhone fine, and the corresponding watch app shows up on my watch. I want to attach the debugger to my watch app, so in Xcode I choose WatchKit App scheme, then choose my iPhone. I hit the run button, and an error window pops up, with title Error Launching 'xxx WatchKit Extension' and description Couldn’t communicate with a helper application.

Both my main app and watch app run fine if I build and run by choosing the main app scheme, however I wish to attach the debugger to my watch app scheme. Does anyone know what might be causing this error? Thanks in advance.

Xcode 6 Crash on Launch error EXC_BAD_ACCESS (SIGSEGV)

Process:               Xcode [3797]
Path:                  /Applications/http://ift.tt/1kAnkB8
Identifier:            com.apple.dt.Xcode
Version:               6.3.1 (7703)
Build Info:            IDEFrameworks-7703000000000000~4
App Item ID:           497799835
App External ID:       812230896
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [3797]
User ID:               501

Date/Time:             2015-05-10 18:38:38.606 -0400
OS Version:            Mac OS X 10.10.3 (14D136)
Report Version:        11
Anonymous UUID:        00D6503E-DBD7-2FE7-3ECF-A8EF678DFC38

Sleep/Wake UUID:       2788F068-DB50-4E00-9B74-E4FC95AC2582

Time Awake Since Boot: 26000 seconds
Time Since Wake:       1700 seconds

Crashed Thread:        7  Dispatch queue: com.apple.dt.Xcode.IBSourceCodeClassProvider

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
--> 
    __TEXT                 0000000109d67000-0000000109d68000 [    4K] r-x/rwx SM=COW  /Applications/http://ift.tt/1kAnkB8

Application Specific Information:
ProductBuildVersion: 6D1002

Thread 0:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                 0x00007fff8b34e0d8 search_method_list(method_list_t const*, objc_selector*) + 58
1   libobjc.A.dylib                 0x00007fff8b35fa21 getMethodNoSuper_nolock(objc_class*, objc_selector*) + 89
2   libobjc.A.dylib                 0x00007fff8b35f89b lookUpImpOrForward + 614
3   libobjc.A.dylib                 0x00007fff8b35f617 lookUpImpOrNil + 20
4   libobjc.A.dylib                 0x00007fff8b359970 _class_resolveInstanceMethod(objc_class*, objc_selector*, objc_object*) + 108
5   libobjc.A.dylib                 0x00007fff8b35f799 lookUpImpOrForward + 356
6   libobjc.A.dylib                 0x00007fff8b352408 class_getInstanceMethod + 60
7   com.apple.Foundation            0x00007fff9205920c NSKeyValueMethodForPattern + 139
8   com.apple.Foundation            0x00007fff92059d89 +[NSObject(NSKeyValueCodingPrivate) _createValueGetterWithContainerClassID:key:] + 319
9   com.apple.Foundation            0x00007fff92059bc8 -[NSObject(NSKeyValueCoding) valueForKey:] + 270
10  com.apple.dt.IDEKit             0x000000010b012249 -[IDENavigableItem childItems] + 111
11  com.apple.dt.IDEKit             0x000000010b020d9a -[IDEFileNavigableItem identifierForChildItem:] + 154
12  com.apple.dt.IDEKit             0x000000010b0206a6 -[IDENavigableItemArchivableRepresentation initWithNavigableItem:] + 368
13  com.apple.dt.IDEKit             0x000000010b03081f -[IDENavigableItem archivableRepresentation] + 50
14  com.apple.dt.IDEKit             0x000000010b1d8093 -[IDEEditorArea selectedNavigableItemArchivedRepresentation] + 106
15  com.apple.dt.IDEKit             0x000000010b17b521 __50-[IDENavigatorArea _handleCurrentNavigatorChanged]_block_invoke + 87
16  com.apple.dt.DVTFoundation      0x0000000109eb45c8 -[_DVTAsynchronousRequest _invokeBlock:] + 58
17  com.apple.Foundation            0x00007fff9207c41b __NSFireDelayedPerform + 364
18  com.apple.CoreFoundation        0x00007fff8e2682e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
19  com.apple.CoreFoundation        0x00007fff8e267f73 __CFRunLoopDoTimer + 1059
20  com.apple.CoreFoundation        0x00007fff8e2db53d __CFRunLoopDoTimers + 301
21  com.apple.CoreFoundation        0x00007fff8e223608 __CFRunLoopRun + 2024
22  com.apple.CoreFoundation        0x00007fff8e222bd8 CFRunLoopRunSpecific + 296
23  com.apple.HIToolbox             0x00007fff90a0956f RunCurrentEventLoopInMode + 235
24  com.apple.HIToolbox             0x00007fff90a092ea ReceiveNextEventCommon + 431
25  com.apple.HIToolbox             0x00007fff90a0912b _BlockUntilNextEventMatchingListInModeWithFilter + 71
26  com.apple.AppKit                0x00007fff931149bb _DPSNextEvent + 978
27  com.apple.AppKit                0x00007fff93113f68 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
28  com.apple.dt.DVTKit             0x000000010a4badda -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 237
29  com.apple.AppKit                0x00007fff93109bf3 -[NSApplication run] + 594
30  com.apple.AppKit                0x00007fff93086354 NSApplicationMain + 1832
31  libdyld.dylib                   0x00007fff964605c9 start + 1

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff96456232 kevent64 + 10
1   libdispatch.dylib               0x00007fff96bafa6a _dispatch_mgr_thread + 52

Thread 2:
0   libsystem_kernel.dylib          0x00007fff9645594a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8e19440d start_wqthread + 13

Thread 3:
0   libsystem_kernel.dylib          0x00007fff9645594a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8e19440d start_wqthread + 13

Thread 4:
0   libsystem_kernel.dylib          0x00007fff9645594a __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff8e19440d start_wqthread + 13

Thread 5:: Dispatch queue: IBPlatformToolRequestQueue.IBCocoaTouchFramework-EightAndLater
0   libsystem_kernel.dylib          0x00007fff96456682 read + 10
1   com.apple.dt.IBFoundation       0x0000000110b15c13 -[IBMessageSendChannel sendMessage:returnValue:context:error:arguments:] + 1252
2   com.apple.dt.IDE.IDEInterfaceBuilderKit 0x0000000115397ef0 -[IBAbstractMessageChannelInterfaceBuilderToolProxy renderImagesForRequests:] + 228
3   com.apple.dt.IDE.IDEInterfaceBuilderCocoaTouchIntegration   0x000000011a239625 0x11a0b5000 + 1590821
4   com.apple.dt.IDE.IDEInterfaceBuilderKit 0x00000001153dba79 -[IBRemoteViewImageRequestProcessor performRequestOnBackgroundThreadWithData:platformTool:] + 89
5   com.apple.dt.IDE.IDEInterfaceBuilderKit 0x0000000115231ccb -[IBPlatformToolRequester processRequests] + 1079
6   com.apple.dt.DVTFoundation      0x0000000109f72cbc __DVTDispatchAsync_block_invoke + 106
7   libdispatch.dylib               0x00007fff96bb1323 _dispatch_call_block_and_release + 12
8   libdispatch.dylib               0x00007fff96bacc13 _dispatch_client_callout + 8
9   libdispatch.dylib               0x00007fff96bb0365 _dispatch_queue_drain + 1100
10  libdispatch.dylib               0x00007fff96bb1ecc _dispatch_queue_invoke + 202
11  libdispatch.dylib               0x00007fff96baf6b7 _dispatch_root_queue_drain + 463
12  libdispatch.dylib               0x00007fff96bbdfe4 _dispatch_worker_thread3 + 91
13  libsystem_pthread.dylib         0x00007fff8e196637 _pthread_wqthread + 729
14  libsystem_pthread.dylib         0x00007fff8e19440d start_wqthread + 13

XCODE crashes on launch.. please help! I've reinstalled Xcode, deleted .userdata and even tried to remake the project by transferrin the existing files, but the new project yields the same error.

seems to be a corruption issues somehow following these specific files, but need to retrieve them.. thanks in advance!

avkit player swift xcode - Looking for a tutorial

I simply want to make something very similar to the Headspace iOS app. I think I can get mostly there but I simply can't figure out where to begin in order to have two main elements - a button that is pressed and plays a video or audio. A tutorial or simple explanation would be great if anybody has encountered one or thinks it's simple to achieve.

Any help would be greatly appreciated.

xcode 6.3

Using storyboard and auto-layout to position buttons by screen percentage

I'm trying to set up some constraints inside a view via storyboard (im not a fan of contrasting via code). My main goal is kinda simple, but tricky : How can i align 3 buttons by PERCENTAGE using Multiplier inside a view?

Example : What do we see? 3 buttons inside a view. The left button is 10% from the view width(from his left side). The second one is centered , and the third one is 10% from the right side.

source

What am i trying to do?

I want to accomplish this using only Horizontal Center in Container and Vertical Center in Container through their Multiplier

What have i done so far?

Until now i tried using trailing and leading spaces constraints, the problem is that its not relative to the view size. Any suggestions guys? I'm trying to figure this out for the last few days.

How to make arabic HTML on macbook?

Does anyone know how to make an arabic html page it in mac?

It has been easily managed in Windows but since I got the macbook I have been stuck

using Text editor, it is not working as simple as notepad, the arabic page doesn't display as it used to on windows

using xcode, the encoding is ruined in the displayed page

I am using the meta tag in the head part for UTF-8 \ and that was enough when I was using notepad on windows beside making sure that notepad encoding is unicode.. but the same steps are not enough on macbook

any solutions please

Xcode project send from freelancer, won't run, says ''build failed''

I just received my iphone app in a xcode file from my freelancer. When i open the project in xcode and clicks ''run'' it says ''build failed'' and i get the following message

http://ift.tt/1cmWeeg

How do i fix this? I am new to xcode and need a detailed description of how to do it.

UITextField not displaying NSFontAttributes

I'm writing in Swift, have an app that includes multiple user-editable textFields and textViews, all with attributedText editing features.

Once edited, information is saved to a CoreData object as well as uploaded to a server for backup. The server saves the AttributedStrings as HTML, and it is converted back to NSAttributedString when downloaded/synced.

All of this works (although I get a lot of extra attributes like paragraph style added), but for some reason, my textFields, once saved and re-loaded, don't display any italic or bold font attributes (even though it exists, is uploaded, downloaded, and converted just fine). Yet the textViews, going through the same process, display the text just fine.

Any idea why a textField would not work and a textView does for displaying attributed text?

Here's some code, I can add more if I'm missing something necessary:

Sample HTML field text:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://ift.tt/nYkKzf">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Optima; color: #000000; -webkit-text-stroke: #000000}
span.s1 {font-family: 'Optima'; font-weight: bold; font-style: normal; font-size: 16.00pt; font-kerning: none; text-shadow: 0.0px -1.0px 0.0px rgba(255, 255, 255, 0)}
span.s2 {font-family: 'Optima-Regular'; font-weight: normal; font-style: normal; font-size: 16.00pt; font-kerning: none; text-shadow: 0.0px -1.0px 0.0px rgba(255, 255, 255, 0)}
span.s3 {font-family: 'Optima'; font-weight: normal; font-style: italic; font-size: 16.00pt; font-kerning: none; text-shadow: 0.0px -1.0px 0.0px rgba(255, 255, 255, 0)}
span.s4 {font-family: 'Optima-Regular'; font-weight: normal; font-style: normal; font-size: 16.00pt; text-decoration: underline ; font-kerning: none; text-shadow: 0.0px -1.0px 0.0px rgba(255, 255, 255, 0)}
</style>
</head>
<body>
<p class="p1"><span class="s1">Check</span><span class="s2"> </span><span class="s3">for</span><span class="s2"> </span><span class="s4">title</span><span class="s2"> here. <span class="Apple-converted-space">Â  Â </span></span></p>
</body>
</html>

NSAttributeString / HTML Converters:

class AttrTextConverter {
func toHtmlString(attrString: NSAttributedString) -> String {
    if let toData = attrString.dataFromRange(NSMakeRange(0, attrString.length), documentAttributes: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], error: nil) {
        let htmlNSString = NSString(data: toData, encoding: NSUTF8StringEncoding)
        let htmlString = htmlNSString as! String
        return htmlString
    }
    return ""
}

func toAttrString(htmlString: String) -> NSAttributedString {
    let htmlNsString = htmlString as NSString
    let htmlData = htmlNsString.dataUsingEncoding(NSUTF8StringEncoding)
    var concreteString : NSAttributedString = NSAttributedString(string: "")
    if let attrString = NSMutableAttributedString(data: htmlData!, options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: NSUTF8StringEncoding], documentAttributes: nil, error: nil) {
        attrString.enumerateAttribute(NSFontAttributeName, inRange: NSMakeRange(0, attrString.length), options: NSAttributedStringEnumerationOptions.allZeros) { value, range, stop in
            if value != nil {
                let oldFont = value as! UIFont
                let oldName = oldFont.fontName
                var newFont = defaultFont
                if oldName.hasSuffix("-BoldOblique") || oldName.hasSuffix("-BoldItalic") {
                    newFont = defaultBoldItalic
                } else if oldName.hasSuffix("-Bold") {
                    newFont = defaultBold
                } else if oldName.hasSuffix("-Italic") || oldName.hasSuffix("-Oblique") {
                    newFont = defaultItalic
                }
                attrString.removeAttribute(NSFontAttributeName, range: range)
                attrString.addAttribute(NSFontAttributeName, value: newFont, range: range)
            } else {
                attrString.addAttribute(NSFontAttributeName, value: defaultFont, range: NSMakeRange(0, attrString.length))
            }
        }
        concreteString = attrString
    }

    return concreteString
}
}

And this is the display code in the viewController:

textView (WORKS):

if let mutStr = lesson?.valueForKey(record) as? NSAttributedString {
                let newStr = fontSet.changeFontFamily(mutStr)
                view.attributedText = newStr
            }

textField (DOESN'T WORK):

if let mutStr = lesson?.valueForKey(record) as? NSAttributedString {
                let newStr = fontSet.changeFontFamily(mutStr)
                field.attributedText = newStr
            }

How to add youtube videos to custom uitableviewcell using uiwebview

i'm new to iOS development. i would like to display few webpages using uiwebview and a label which are on a custom table cell i've succeeded in getting different names for different cell but getting same url in each custom cell. how can i get different URLs for different cell ![enter image description here][1]

How to implement the viewForZoomingInScrollView: and scrollViewDidEndZooming:withView:atScale: methods

I'm trying to follow the instructions from this post How to zoom in/out an UIImage object when user pinches screen? but I don't know how to implement these methods. I know that is a basic question but if anyone could take a minute to help a beginner I would greatly appreciate it thanks!

Edit: I don't know what goes in the () for the viewForZoomingInScrollView method. My error is unresolved identifier 'viewForZoomingInScrollView'.

This stuff is incredibly difficult to figure out for a beginner... is there an easier way to learn coding??

import UIKit

class ViewController: UIViewController, UIScrollViewDelegate {

@IBOutlet weak var ImageView: UIImageView!
@IBOutlet weak var scrollView: UIScrollView!



override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

    scrollView.delegate = self

    viewForZoomingInScrollView(UIScrollView:scrollView) {

        return self.ImageView;

    }
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

}

Testflight iOS Minimum Requirement different than XCode

In xcode my project's iOS deployment target is 8.0 (in both the build settings and the general target info) yet when it uploads to testflight it changes to 8.3 as the minimum requirement. Is there another setting I'm missing? Thanks

Xcode 5.1 crashing when i try to open .xib file

I am using xcode 6.1.I have created App using Autolayout.I wanted to test the app on ios6 so i Download the xcode 5.0 when i try to open .xib File xcode is crashing.

Remove iAd banner from just 1 scene

I have a basic game created with 3 scenes - Start, GameScene and Gameover Scene. I implemented iAd banners very easily using the below code. This was super simple for me as a beginner to do, however the banner ad seems to be impacting the frame rate during game play so I want it to be removed/hidden during the game scene. Is there any easy way to do this ?

override func viewDidLoad() {

       super.viewDidLoad()
      self.canDisplayBannerAds = true

How to set multiple variables in a FOR loop?

I'm programming in Swift and I'd like to set up a couple of variables in a single loop. These are UIButtons and they all require the same settings. However I don't know how to refer to these variables using "i". This is what I tried:

var gg1:UIButton = UIButton.buttonWithType(UIButtonType.System) as! UIButton
var gg2:UIButton = UIButton.buttonWithType(UIButtonType.System) as! UIButton
var gg3:UIButton = UIButton.buttonWithType(UIButtonType.System) as! UIButton

//further in the code
for i in 1...3 {
    gg(i).layer.anchorPoint.x = 0
    gg(i).titleLabel?.font = UIFont(name: "Arial", size: 20*rightFontSize)
    gg(i).setTitleColor(UIColor.blueColor(), forState: UIControlState.Normal)
    gg(i).sizeToFit()
    gg(i).center = CGPointMake(w/20,11*h/10)
    scrollView.addSubview(gg(i))
}

Viewing an array and tuple in Xcode 6.3 Playground

Prior to Xcode 6.3 when I clicked the Quick Look icon on the left in Playground file, it showed the array along with item indexes. Now it shows only "X elements" text and nothing else. Same thing happened with tuples. It's quite annoying since not always all elements fit in the sidebar. How to fix this?

Android material animations in ios cocoa touch

Apologies for the generic question however I am in need of some guidance so that I can do further reading.

The question is:

Is it possible to do UI transitions similar to android material UI transitions in IOS Cocoa touch? Can core graphic or core animation do complex shape tweening like flash (not just animating simple properties such as opacity or size.

For example please have a look at the following link: http://ift.tt/1EtHReD

How can such animation effects be accomplished in cocoa touch?

Any pointers would be useful so that I can do further reading.

Many thanks

UIImage not rendering in Xcode 6.3.1 Playground

I spent two hours trying to make this simple code to work, with no luck.

What I did:

  • I put a resource in the Resources directory.
  • I referenced the resource as UImage(named: "resource.jpg")

However, nothing is showing up. Here's a snapshot of my screen. As you can see there's no playground indicator running.

enter image description here

swift how make animation flip between two UIViews

I'm trying to create an IOS app and flip two views when pressing some buttons. I have found the flip animation but I want the flip to change the content to the new view when it is flipped 90° and not when the animation is completed. This is my function:

func animationFlip(fromView:UIView, toView:UIView, animationTime:Float)
{

    UIView.animateWithDuration(NSTimeInterval(animationTime), animations: {

        UIView.setAnimationTransition(UIViewAnimationTransition.FlipFromRight, forView: fromView, cache: true)

        },completion:{completion in
            UIView.animateWithDuration(NSTimeInterval(animationTime), animations: { () -> Void in

                fromView.hidden = true;
                toView.hidden = false;
                UIView.setAnimationTransition(UIViewAnimationTransition.FlipFromRight, forView: toView, cache: true)


            })
    })
}

I have found this code which seems to do the trick but it is written in obj-c. How can it be translated to swift?

[UIView transitionFromView:viewToReplace
        toView:replacementView
        duration:1
        options:UIViewAnimationOptionTransitionFlipFromBottom
        completion:nil];

Thanks in advance!

How to remove iPhone 4s and lower compatibility from Xcode project

iTunes Connect always asks me for 3.5 inch snapshots, how can I get rid of it?

How to present a new viewController without a action?

Im trying to push to a new viewController if a user is logged in, but I don't really understand were it fails or how the best why of presenting a viewController.

how can i set the window hierarchy? or push a viewController programmatically without a button action?

    if (FBSDKAccessToken.currentAccessToken() != nil)
    {
        returnUserData()
        var storyboard: UIStoryboard = UIStoryboard(name:"Main", bundle:nil)

        var vc: UINavigationController = storyboard.instantiateViewControllerWithIdentifier("loggedInViewController") as! UINavigationController

        self.presentViewController(vc, animated: true, completion: nil)
        // User is already logged in, do work such as go to next view controller.
    }

error message:

User Logged In 2015-05-10 16:35:18.010 noscrubs[32134:43488091] Warning: Attempt to present on whose view is not in the window hierarchy!

thanks a lot for any help I really want to get into the flow, so all pointers are appreciated!

UITableView in Swift: Offscreen cells are not pre-loaded

I have a little problem with UITableView. Cells that are offscreen are not loaded when I first scroll down. When I scroll up (so that the not showing cells are offscreen again) and scroll down again they suddenly show up. I think this has something to do with dequeueReusableCellWithIdentifier. Any idea how to fix this?

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! CustomCellClass
return cell