Search results for

file uri scheme

78,568 results found

Post

Replies

Boosts

Views

Activity

how to reset/restart an animation and have it appear continuous?
So, I am fairly new to iOS programming, and have inherited a project from a former coworker. We are building an app that contains a gauge UI. When data comes in, we want to smoothly rotate our layer (which is a needle image) from the current angle to a new target angle. Here is what we have, which worked well with slow data: -(void) MoveNeedleToAngle:(float) target { static float old_Value = 0.0; CABasicAnimation *rotateCurrentPressureTick = [CABasicAnimation animationWithKeyPath:@transform.rotation); [rotateCurrentPressureTick setDelegate:self]; rotateCurrentPressureTick.fromValue = [NSSNumber numberWithFloat:old_value/57.2958]; rotateCurrentPressureTick.removedOnCompletion=NO; rotateCurrentPressureTick.fillMode=kCAFillModeForwards; rotateCurrentPressureTick.toValue=[NSSNumber numberWithFloat:target/57.2958]; rotateCurrentPressureTick.duration=3; // constant 3 second sweep [imageView_Needle.layer addAnimation:rotateCurrentPressureTick forKey:@rotateTick]; old_Value = target; }The problem is we have a new dat
2
0
4.3k
Jun ’15
Error when opening Blender 2.74 .obj, .stl or .ply export files in Xcode7 beta
Dear all,I'm hoping someone will be able to advise me on how to resolve this error. I have tried numerous times to open files exported from Blender 2.74 in .obj, .stl or .ply formats, but get the same error message each time: 'The document testCube.obj could not be opened. Unknown or missing file'.Below is a description of how I generate the error, starting with the default cube object in Blender 2.74 and ending with Xcode7 beta:Open Blender. The 3D viewport contains the default cube object.In the Properties Window, click on the Materials buttonIn the Diffuse panel, set the colors to Red: 0.5, Green: 1.0, Blue: 1.0Save the file as 'testCube' to a folder on my desktopSelect File > Export > Wavefront(.obj)In the resulting Export window, click 'Export OBJ' without making any adjustments to the default settings in the 'Export OBJ' panel on the left hand side.Two files are saved to my folder: testCube.obj and testCube.mtlFirst approach to opening the file
2
0
1.8k
Jun ’15
Using single image vs @2x & @3x
So I've started to build my super game using SpriteKit. And there is one problem I can resolve with two different ways.When creating a sprite it is needed to point .png-file (SKSpriteNode(imageNamed: hero))..PNG file can be in .xcassets folder and have several versions (@2x, @3x) for each device (4s, 5, 6, 6+). But there is a way to use just one .png file and set correct scale property for a sprite.Is it a good practice to use one image and set scale or it is better to use concrete file (@2x or @3x) for a cpecific device?Pros using one file – smaller app size.
3
0
6k
Jun ’15
Bundle Identifier Change Core Data Lost
Hello,I changed a project from Objective-C to Swift and created a whole new project when I did this. I have an app in the AppStore and wanted to send an update instead of releasing a new app. I understand that my Bundle Identifier needs to be the same when updating an app. When preparing the app for release, I changed my Bundle Identifier to match my app in the AppStore - since I started with a new project - and in the process my Core Data file seems to be missing. If I change my Bundle Identifier how do I keep access to Core Data?Take care,Jon
3
0
3.9k
Jun ’15
Reply to watchOS 2 framework failing
Remember, there are two ways to share code between targets - frameworks, and just including the .m or .swift file in multiple targets using Xcode's inspector. I've not started using Xcode 7 yet, but in one app I have a framework that is shared between the iOS app, the iOS today widget and the watchOS 1 extension.From what you've described, that framework isn't going to work with a watchOS 2 extension because that extension runs on a completely different device. Which makes perfect sense! However, instead of creating a new Watch Framework target, including the same files in that target as in my existing framework and linking the watchOS 2 extension with that framework, an alternative might be to simply add those files to the watchOS 2 extension, cutting out the need for a framework entirely. There's not more than one target running on the Watch to share code between, so a framework doesn't really save you any space (which it does on iOS when used by multiple targets).In my case, not
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to watchOS 2 framework failing
It didn't even occur to me to have the same source files for multiple targets. It looks like this was implied on this thread. In my case, you are right that because there's only one watch app using code in my framework, I won't save space (I'll potentially use more space). However, because I've already isolated much code into a framework, it should be a simple migration step to add a Watch framework and add all the source files to this new target. I could add these files directly to the watch extension target and avoid app groups on the watch, but I think I'll stick with the framework for now. You never know when you'll have a second watch app.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
Reply to Swift from the commandline
Below is the Webkit Browser in 30 Lines of Swift from practicalswift.com, with some small changes to make it run on latest beta with Swift 2.(Omitted link because this will get stuck in moderation otherwise ...)1. Create a file called browser.swift (or whatever) containing this:#!/usr/bin/swift import WebKit let application = NSApplication.sharedApplication() application.setActivationPolicy(NSApplicationActivationPolicy.Regular) let window = NSWindow(contentRect: NSMakeRect(0, 0, 960, 720), styleMask: NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask, backing: .Buffered, `defer`: false) window.center() window.title = Minimal Swift WebKit Browser window.makeKeyAndOrderFront(window) class WindowDelegate: NSObject, NSWindowDelegate { func windowWillClose(notification: NSNotification) { NSApplication.sharedApplication().terminate(0) } } let windowDelegate = WindowDelegate() window.delegate = windowDelegate class ApplicationDelegate: NSObject, NSApplicationDelegate { var _window: NSWi
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
Slow copy operations
Has anyone else been seeing really slow copy operations with the first beta? I just downloaded the Xcode 7 beta and have noticed that copying it and other files can take a very long time. It spends a very long time on preparing to copy before it actually starts the copy operation.
2
0
1.1k
Jun ’15
JS closure causing odd behavior with JXA
I'm using JXA to build Cocoa applications and running into a strange issue when attempting to wrap all an app's JavaScript with an immediately-invoked function expression.What's the issue?If the code for an app with a single NSWindow is wrapped in an immediately-invoked function, the app's window will close on it's own without any type of application crash. The app stays running.Here's the code I'm using:(function() { ObjC.import(Cocoa); var styleMask = $.NSTitledWindowMask | $.NSClosableWindowMask | $.NSResizableWindowMask | $.NSMiniaturizableWindowMask; var window = $.NSWindow.alloc.initWithContentRectStyleMaskBackingDefer( $.NSMakeRect(0, 0, 800, 400), styleMask, $.NSBackingStoreBuffered, false ); window.center; window.title = 'NSWindow Closure Bug?'; window.makeKeyAndOrderFront(window); }());Here's the example application https://dl.dropboxusercontent.com/u/271215/jsclosurebugexample.zipor recreate it with- Script Editor > New- Copy/paste the above code- Save > File Format: Applicat
2
0
1k
Jun ’15
Reply to Problem with Overlapped Textures and Transparent Pixels
I read about SpriteKit and texture atlases a bit more, and it looks like the trimming is considered a feature rather than a bug.https://developer.apple.com/library/ios/recipes/xcode_help-texture_atlas/AboutTextureAtlases/AboutTextureAtlases.htmlThose new images are automatically rotated and trimmed to fit the maximum number of images into a single file...So it sounds like you would need to use the 1% alpha workaround you mentioned above, or use the default centered anchor point on the sprite and textures.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
how to store data in the app
Hi there, I'm still new to the development world.I want to ask you guys about how I could store data -like audio files or PDFs- inside the app -universal app- with objective-c ?? so the user can view, play, add to favorite or search them. without editting or deleting any of them.please help me & thanks in advanced .. 🙂
2
0
272
Jun ’15
Reply to Error about minimum deployment target
Anything from the Xcode 7 b releases notes shed light?Playgrounds Opening a Playground that was previously displaying the Version Editor may present an alert stating, “The file “MyPlayground.playground” couldn’t be opened because you don’t have permission to viewit.” (20623808). Workaround: Dismiss the alert dialog and show the Standard Editor (Command-Return).Playgrounds sometimes show a window with no editor if they are opened as part of Xcode launching (20694143) Workaround: Close and re-open the playground.Executing an iOS Playground for the first time may take longer than subsequent executions. (21163503)For old-style playgrounds, the menu item Edit->Convert->To Latest Swift Syntax... is greyed out. (20902099) Workaround: Upgrade the playground before attempting to convert to Swift 2.0 by choosing Editor- >Upgrade Playground...Playground pages may recompile each time they are navigated to, even when there are no changes. (21177662)Playgrounds live views may not show images when using th
Jun ’15
Reply to how to store data in the app
For tiny data (strings, dates, numbers etc.) there is NSUserDefaults or the keychain.For medium sized data (or lots of tiny data) there is Core Data or SQLite (I like SQLite with FMDB) or some other database.For large data like audio files or PDFs I would think individual files on the file system. Take a look at NSFileManager and related guides - there's lots of documentation on the Apple dev site. (File System Programming Guide)
Jun ’15