The documentation I've found is terribly unclear on this - what I'd like to do is use the provided Xcode image library (catalog?) on a Mac OS X application.
iOS apps get the benefit of being able to use UIKit's UIImage object to quickly reference image files that are loaded into the catalog.
(To wit: UIImage(imageNamed: "Something"))
Since I'm writing a Mac OS app and not an iOS app, I don't get UIKit.
I'd assume that since XCode provides me with the same image library file by default on an OS X app, that I'm somehow intended to make use of it.
How do I reference images inside the library? Ideally I'd be able to do something with NSImage
In this situation, you can use NSImage just like UIImage:
NSImage(named: "Something")
Related
I am still new to watchOS and trying to understand how the architecture works. I have a watchOS 3 app that I have been working on that uses UIImage in my WatchKit extension. I do some operations with UIImage from assets in the extension. What I can't tell is where these UIImage manipulations happen, is it on the watchOS or on iOS? In some tutorials I read, it sounds like assets for extensions are stored in iOS and UIImage being form UIKit makes me believe its on iOS. Apple's WatchOS programmers guide has these 2 images:
Apple says this image shows the relationship between the Watch app interface, the WatchKit extension, and the iOS app.
Apple says this image show the structure of a watchOS app. This seems to imply images are stored on watch.
I couldn't find any answers in the tutorials or programmers guide and the images used to describe how the watchOS works confused the situation even more.
In WatchOS3 the watch extension code definitely runs on the Watch. This is what the first diagram is showing.
The watch app assets will also be on the watch - I think this is the "Storyboards and Resources" in the second diagram.
Your confusion probably arises from the fact this was different in WatchOS 1, when the extension did actually run on the phone. Maybe you were reading old tutorials?
Anyway I hope that helps!
We're developing an OSX app that have to be supported by OSX 10.7 to 10.9. We're currently using QTKit and QTMovieView to show videos, but when trying to upload a new version recently we got this error message:
Deprecated API usage. Apple no longer accepts submissions of apps that use QuickTime APIs.
We have also tested to set the Base SDK to 10.8, but same result there.
And changing to AVKit and AVPlayerView does not work for version prior to 10.9.
So is there a way to use AVKit for versions prior to 10.9 or some way to publish an app with QTKit?
You can't use AVKit on OS X versions prior to Mavericks.
But AVKit is a very small framework that only consists of a player view that has some advanced features out of the box (e.g. chapter navigation, selection & trimming, ... - similar to QTMovieView).
If your app doesn't require those features, you can easily implement a view with simple playback functionality with AVFoundation-only classes (AVFoundation was introduced with OS X 10.7).
Instead of AVPlayerView, you can use a combination of AVPlayer & AVPlayerLayer.
There is some Apple sample code that shows how to build a DIY player view here:
https://developer.apple.com/library/mac/samplecode/AVSimplePlayerOSX/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011060
This custom player view supports:
Play/Pause
Rewind
Playback progress
Fast forward
Volume control
I have created .icns using .iconset for my Mac app,containing all sizes of icon recommended by apple. But still I cannot see my app icon when I install and launch my app on Mac osX 10.5
Following Apple's current guidelines and using their latest toolset will give you icons that only work in newer versions of OS X. To get a set of icons that includes larger (#2x retina) resolutions and 10.5 compatible image formats, you need to use Uli Kusterer's oldiconutil.
Also, please see this related question--sometimes icon file sizes can be too large for 10.5, and require extra image compression.
Fairly new to the Xcode Developer API and need a little help. When a project is first opened in Xcode, the Object Library displays the full list of UIKit objects available (and other linked frameworks I believe). However, when I switch files in the project navigator to/from any file (.m, .h, .xib, etc), the Object Library list changes; most of the objects are missing - such as NSButton, NSTableView etc. The standard objects are still visible - Label, Round Rect Button, Text Field, etc.
Closing and re-opening the same project appears to restore the Object Library list, but the same issue happens once a different file is opened.
Using Xcode Version 4.2.1, Build 4D502.
Help!
I think I see what you are describing. When I first open an iOS project the Object Library is showing objects that are valid for OS X but not iOS (like File Menu Item). When I switch to a xib file the Object Library gets updated to show only the objects that are valid for iOS. Ideally I suppose that wouldn't happen but since you can't do anything with the Object Library while a source file is in the editor no harm is done.
If you are developing application for iOS(iPad or iPhone) you will not get that library which contains pop button , check box ,NSButton, NSTableView etc,that library is available for OS X app development.
OS and OS X don't use the same graphics library. iOS and OS X development are similar, but not the same. For example - you don't have Cocoa Bindings on iOS.
I you want to check then make one project for iOS & then see your library contents,then create another project for OSX & see your library contents... :D
Is there any way to create an app for the Mac App Store in much the same way as you do for the iPhone/iPad app store? Using Interface Builder or some similar program for creating views that will connect to the code with IBOutlets and IBActions?
If not, can anybody outline what is needed to create Mac Apps as opposed to iOS apps and perhaps point to a good tutorial, sample source code, or documentation resource?
Thanks for your help!
The technology is much the same for both Mac OS and iOS. You use Xcode and Interface Builder. iOS uses CocoaTouch whereas Mac OS X uses Cocoa (from which CocoaTouch was derived).
It's basically the same, but instead of UIViewControllers you use NSViewControllers. NSView is slightly different from UIView but the subview-mechanism is identical.