So far, my foray into Swift is going decently well. But I'm trying to re-write
some code that uses IOKit and sys/fcntl.h, and while the IOKit calls are
fine, it doesn't like me trying to call fcntl(). It says, Use of unresolved
identifier 'fcntl'.
I've tried including sys/fcntl.h in my
On Oct 15, 2014, at 6:40 AM, Charles Jenkins cejw...@gmail.com wrote:
Thanks for looking it over. :-) I guess I misunderstood the documentation. I
thought if you dragged out a table view from the palette into a NIB, you got
a full hierarchy of objects (including the extra scroll view I
On 18 Oct 2014, at 5:25 pm, Rick Mann rm...@latencyzero.com wrote:
So far, my foray into Swift is going decently well. But I'm trying to
re-write some code that uses IOKit and sys/fcntl.h, and while the IOKit
calls are fine, it doesn't like me trying to call fcntl(). It says, Use of
WebFrame *mainFrame = [ webView mainFrame ];
DOMDocument *domDoc = [ mainFrame DOMDocument ];
When I print domDoc, I get with 10.9 something like:
DOMHTMLDocument [#document]: 0x105df8400 '' with 1 children
DOMHTMLHtmlElement [HTML]: 0x10401c660 '' with 3 children
Hi,
I am creating a Desktop issue tracking app using core data and the
NSDocument framework - so yes, the Xcode wizard extended
NSPersistentDocument which provides me with an NSManagedObjectContext.
My question is - if I start working in the app, creating issues for
instance ... when I go to
When using NSPersistentDocument it takes over responsibility for saving the
context. You should not save the context yourself.
On 18 Oct 2014, at 17:00, Luther Baker lutherba...@gmail.com wrote:
Hi,
I am creating a Desktop issue tracking app using core data and the
NSDocument framework -
I'd like to save my Document based app in the bundle style format. IE: I'd
like to save things in a directory - like apps like OmniOutliner do.
Out of the box, I get the option to save as sqlite, binary or XML. What I'd
like is to save a 'bundle' with my own extension and nest things like the
the
Thanks Mike.
Let me ask another question ... what if I need to create a temporary,
thread specific NSManagedObjectContext? Let's say I'm interacting with a
RESTful API ala AFNetworking and I need to parse and save data on a
background response thread.
How do I tie my thread specific context into
On 18 Oct 2014, at 17:06, Luther Baker lutherba...@gmail.com wrote:
I'd like to save my Document based app in the bundle style format. IE: I'd
like to save things in a directory - like apps like OmniOutliner do.
Out of the box, I get the option to save as sqlite, binary or XML. What I'd
On 18 Oct 2014, at 17:09, Luther Baker lutherba...@gmail.com wrote:
Thanks Mike.
Let me ask another question ... what if I need to create a temporary, thread
specific NSManagedObjectContext? Let's say I'm interacting with a RESTful API
ala AFNetworking and I need to parse and save data
Coming from an iOS background, I'm used to seeing (and encapsulating) the
creation of key Core Data components (persistent store, location,
contexts). Everything is pretty explicit and consequently easy to follow.
When I use Xcode to generate a desktop Document based app for me, that
Awesome! Thanks Mike.
By the way, I'm a happy Hit List user!
-Luther
On Sat, Oct 18, 2014 at 11:10 AM, Mike Abdullah mabdul...@karelia.com
wrote:
On 18 Oct 2014, at 17:06, Luther Baker lutherba...@gmail.com wrote:
I'd like to save my Document based app in the bundle style format.
As an aside, I'm sure it is well-known, there is some funny caching going
on.
If I open the app the first time (and pre-populate the context with data) -
I cannot actually SAVE.
If I formally shut the app down by quitting the app and choosing Don't
Save, then subsequent restarts exhibit the same
Hi Roland,
Thanks for the followup. I've created a proper git rep on github rather than
just a gist. Most of my github reps seem to be this kind of mini demonstration
project and I was trying to avoid yet another one.
https://github.com/SheffieldKevin/swift-objectivec
What version of Xcode
On 18 Oct 2014, at 17:33, Luther Baker lutherba...@gmail.com wrote:
As an aside, I'm sure it is well-known, there is some funny caching going on.
If I open the app the first time (and pre-populate the context with data) - I
cannot actually SAVE.
If I formally shut the app down by
I've now found an acceptable solution.
Rather than a property I've added an optional method to the protocol which then
in its implementation assigns using the property, pretty much to make sure that
the function/block is copied. I declared the method like so:
On Oct 18, 2014, at 5:33 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:
Note: the head has only 12 children (the first 10 are identical to 10.9), and
there is no body at all.
Weird! Are you sure that the page has finished loading by the time you made the
call? Maybe your code is
I need access to fcntl, so I thought I'd do what Apple does with Darwin. But I
don't actually see how to do that. They create Darwin.stdio.fopen(), for
example. But then how do they call the underlying C fopen()?
For that matter, Swift can call C functions directly in some cases, and not at
Hi, I have a parent view controller that has two UICollectionViewController
subclasses as children in its view controller hierarchy. I'd like to set
the parentViewController as the Subclass1CollectionViewController and
Subclass2CollectionViewControllers' .colllectionView UIScrollView delegate.
AFAIK, variadic C functions are not (yet) callable from swift code.
Le 18 oct. 2014 à 20:37, Rick Mann rm...@latencyzero.com a écrit :
I need access to fcntl, so I thought I'd do what Apple does with Darwin. But
I don't actually see how to do that. They create Darwin.stdio.fopen(), for
On Oct 18, 2014, at 2:22 PM, Mazzaroth M. taomaili...@gmail.com wrote:
Hi, I have a parent view controller that has two UICollectionViewController
subclasses as children in its view controller hierarchy. I'd like to set
the parentViewController as the Subclass1CollectionViewController and
It looks like a couple of people have asked about this in the past, but none of
the answers are working for me. I am trying to clear the contents of a
NSSearchField and have it go back to its empty state. I don’t have a
pre-Yosemite Mac handy to check if this is a bug / new behavior in
Yeah, I tried that initially. An invalid parameter exception comes flying out
of NSCell’s setStringValue.
On Oct 18, 2014, at 14:59, Gerd Knops ge...@bitart.com wrote:
Did you try to set it ti nil instead of an empty string?
Gerd
On Oct 18, 2014, at 4:51 PM, Randy Widell
I’m learning about toolbar buttons/icons on Yosemite (probably not much
different than before, but…I’m an iOS guy so its new for me). I have a few
basic, 101-style questions that I hope somebody can point me to the right place
for:
1. How do you do a popup menu button like the sidebar icon
On Sat, Oct 18, 2014, at 04:51 PM, Randy Widell wrote:
That works somewhat, but not really. Half the time the search field
remains the first responder as if the call to set the outline view as the
first responder never happened.
Have you tried forcing the text field to give up first responder
On 19 Oct 2014, at 5:23 am, Jean-Daniel Dupas mail...@xenonium.com wrote:
AFAIK, variadic C functions are not (yet) callable from swift code.
They aren’t - I didn’t remember fnctl() was varidadic. I shall quote an Apple
engineer then ..
This is not possible in Swift. C variadics are
Yeah, that doesn’t work either. I’m clearing the search field in response to a
change in selection in an outline view. Which means the search field is
already not the first responder. So, setting the first responder to nil just
makes the outline view give up first responder without affecting
1) This is pretty easy. Just create a Pop Up Button, then switch its style to
“Pull Down”. This will give you a push button with the single down arrow on
the right. Then just edit the Pop Up Button’s menu. You can give it an icon,
and then size it down horizontally so that only the icon is
On Oct 18, 2014, at 8:31 PM, Randy Widell randy.wid...@gmail.com wrote:
1) This is pretty easy. Just create a Pop Up Button, then switch its style
to “Pull Down”. This will give you a push button with the single down arrow
on the right. Then just edit the Pop Up Button’s menu. You can
Sorry, forgot that giving the Pop Up Button an icon isn’t exactly
straightforward. You want to create an menu item at the top of the menu that
has the icon but no text. Then add the rest of your menu items below it. The
Pop Up Button will display with the icon, but the first menu item will
I second this site. It’s really useful for finding icons. Just be warned that
some of them don’t look like Apple icons and may feel out of place, even with
the new flat design style.
Agreed. They work well for the application I am working on, but, yeah, that
might not be the case for
On Oct 18, 2014, at 16:40 , Roland King r...@rols.org wrote:
On 19 Oct 2014, at 5:23 am, Jean-Daniel Dupas mail...@xenonium.com wrote:
AFAIK, variadic C functions are not (yet) callable from swift code.
They aren’t - I didn’t remember fnctl() was varidadic. I shall quote an Apple
So you get to go wrap fcntl() in something else it seems.
So, how would I do that, exactly? I suppose I have to pass Objective-C
collection types to a method (which could be a straight C function) from a
Swift call? That is, can a Swift variadic call translate into a C function
call
On 19 Oct 2014, at 9:03 am, Rick Mann rm...@latencyzero.com wrote:
On Oct 18, 2014, at 16:40 , Roland King r...@rols.org wrote:
On 19 Oct 2014, at 5:23 am, Jean-Daniel Dupas mail...@xenonium.com wrote:
AFAIK, variadic C functions are not (yet) callable from swift code.
They
On Oct 18, 2014, at 18:22 , Roland King r...@rols.org wrote:
Write a simple c wrapper around the thing you’re trying to do and that
bridges across to swift. You could probably try to write something really
generic which wraps fcntl() using an UnsafeMutablePtrUInt8 as a final
argument
Wait, if variadic calls aren't supported, how is it that NSLog() can be called?
On Oct 18, 2014, at 18:22 , Roland King r...@rols.org wrote:
On 19 Oct 2014, at 9:03 am, Rick Mann rm...@latencyzero.com wrote:
On Oct 18, 2014, at 16:40 , Roland King r...@rols.org wrote:
On 19 Oct
On Oct 18, 2014, at 19:17 , Roland King r...@rols.org wrote:
On 19 Oct 2014, at 10:11 am, Rick Mann rm...@latencyzero.com wrote:
Wait, if variadic calls aren't supported, how is it that NSLog() can be
called?
Probably has a version which takes a va_list.
type
import Swift
That's what I ended up doing (setNonblocking(int inFileDescriptor)), but, I
was asking for the sake of learning the language. It would be nice to have
generic replacements for fcntl() and ioctl().
The best replacement would be to have a set of functions which took the Swiss
Army knife
In Obj-C, I typically subclass NSWindowController and override -init to call
-initWithNibName:. I do this so the caller doesn't have to worry about how to
make one of these window controllers:
@implementation MyWindowController
- (id) init
{
self = [super initWithWindowNibName: MyWindow
In an NSWindowController subclass init method, I want to call
-loadNibNamed:owner:topLevelObjects, but that requires I have a bundle. I can
get the main bundle, but I'd rather get the bundle for this class (makes it
useable in unit tests).
But, inside an init method, I'm not allowed to
Hi Rick,
According to the latest documentation pack that arrived on Thursday, Swift has:
convenience init(windowNibName windowNibName: String,
owner owner: AnyObject)
So just use this. Like C++, Swift has overloaded method names, so 'init' can
take various parameter combinations.
I realize, in this case, I should be loading in loadWindow(), but it still
seems problematic.
On Oct 18, 2014, at 20:25 , Rick Mann rm...@latencyzero.com wrote:
In an NSWindowController subclass init method, I want to call
-loadNibNamed:owner:topLevelObjects, but that requires I have a
On 19 Oct 2014, at 2:25 pm, Rick Mann rm...@latencyzero.com wrote:
In an NSWindowController subclass init method, I want to call
-loadNibNamed:owner:topLevelObjects, but that requires I have a bundle. I can
get the main bundle, but I'd rather get the bundle for this class (makes it
On Oct 18, 2014, at 20:33 , Graham Cox graham@bigpond.com wrote:
According to the latest documentation pack that arrived on Thursday, Swift
has:
convenience init(windowNibName windowNibName: String,
owner owner: AnyObject)
So just use this. Like C++, Swift has
On Oct 18, 2014, at 20:36 , Graham Cox graham@bigpond.com wrote:
On 19 Oct 2014, at 2:25 pm, Rick Mann rm...@latencyzero.com wrote:
In an NSWindowController subclass init method, I want to call
-loadNibNamed:owner:topLevelObjects, but that requires I have a bundle. I
can get the
On 19 Oct 2014, at 2:43 pm, Rick Mann rm...@latencyzero.com wrote:
Sorry, I was conflating Obj-C and Swift syntax. I'm trying to do this all in
swift, in which case it's:
NSBundle(forClass: self.dynamicType)
But you can't call this in an initializer before calling super init.
On Oct 18, 2014, at 20:47 , Graham Cox graham@bigpond.com wrote:
On 19 Oct 2014, at 2:43 pm, Rick Mann rm...@latencyzero.com wrote:
Sorry, I was conflating Obj-C and Swift syntax. I'm trying to do this all in
swift, in which case it's:
NSBundle(forClass: self.dynamicType)
Is it possible to keep an NSComboBox in the tabbing ring if I set its
Behavior to Selectable. Tabbing reaches the control if the textfield is
editable but I don't want to allow the user to type randomly into the text
field ... but unfortunately, once I remove its editability, the tabbing
cycle
On 19 Oct 2014, at 00:52, Jens Alfke j...@mooseyard.com wrote:
On Oct 18, 2014, at 5:33 AM, Gerriet M. Denkmann gerr...@mdenkmann.de
wrote:
Note: the head has only 12 children (the first 10 are identical to 10.9),
and there is no body at all.
Weird! Are you sure that the page has
On 19 Oct 2014, at 2:54 pm, Rick Mann rm...@latencyzero.com wrote:
You're probably right about that, but in this case, you wouldn't be able to
pass self for owner:
True, but since Swift has the other form of init anyway, you don't have to do
this yourself...
--Graham
50 matches
Mail list logo