Hi,
Is the following ok for getting a CFArrayRef and retaining it until dealloc
time? Whenever refreshGlobalWindowArray is called I want the existing copy to
be released and the new value to be retained.
This is a Mac Project using manual memory management.
All the Best
Dave
@property
Dear Cocoa List,
I’m trying to remove an application package using
NSFileManager.defaultManager().removeItemAtPath(self.appPackage, error: error)
The application package was put at this location using
NSFileManager.defaultManager().copyItemAtURL(pathURL as! NSURL, toURL:
self.appPackage,
Hi,
I’m using the Scripting Bridge, and I was wondering if it ok to subclass SBXXX
classes. Basically, I have a header file generated by the “sdp” tool with
definitions as below:
And I’d like to subclass this to add some extra wrapping to hide some of the
nastiness from the rest of the app
var currentValue = 1
let newNewGenerator = anyGenerator
{
()-Int? in
let previousValue = currentValue
currentValue *= 2
return ( previousValue 20 ) ? nil : previousValue
}
let newGeneratedArray = Array( newNewGenerator )
For some reason you have to specify
On Jun 29, 2015, at 9:14 AM, Gavin Eadie ga...@umich.edu wrote:
Can anyone, with more knowledge than we have, suggest a trick that allows an
apparently synchronous call on the main thread without impacting performance?
Not without some nasty hacks that I wouldn’t recommend.
The simplest
On Jun 28, 2015, at 11:35 PM, Henrik Granaas-Helmers helm...@me.com wrote:
1. NSUserDefaults seems to allocate 16 MB memory at load. I can't see myself
using a megabyte—let alone 16 of those. It would be very interesting to know
why it allocates so much, and if there is a way to encourage
On Jun 28, 2015, at 11:35 PM, Henrik Granaas-Helmers helm...@me.com wrote:
Hi there,
I am new to Apple development, and new to this list. I have two questions
about memory on OS X.
1. NSUserDefaults seems to allocate 16 MB memory at load. I can't see myself
using a megabyte—let
It’s standard knowledge that any operation which causes an app’s main thread to
wait is bad, and that diverting such delays off the main thread allows the app
to remain optimally responsive to external events. That diversion can happen
via a couple of mechanisms: ‘callbacks’ (delegation and
On Jun 28, 2015, at 9:59 PM, Juanjo Conti jjco...@carouselapps.com wrote:
Is it is suppose to call MyApp with something as argument? How do I read
something from the run app?
Your app delegate will be called and given the URL, although it’s been a long
time since I implemented this
On Jun 29, 2015, at 10:14 AM, Gavin Eadie ga...@umich.edu wrote:
While it seems clear to me and my friend that this in an inescapable fact of
life, we have a counterexample in the form of the Canon ED-SDK, which somehow
does accomplish this.
I seriously doubt that. It's probably performing
Use a background task to do the real work then deliver the result on a
queue. mUseba synchronous call to fetch the result from the queue or return
an error result if the queue is empty.
--
Michael David Crawford, Consulting Software Engineer
mdcrawf...@gmail.com
http://www.warplife.com/mdc/
It always helps people answer questions if you post the exact error you get.
Generally when there are mysteriously un-deletable files, it has something to
do with filesystem extended attributes like ‘immutable’. You can display these
by using “ls -l@“.
—Jens
Found it Jens:
func applicationWillFinishLaunching(aNotification: NSNotification?) {
var appleEventManager:NSAppleEventManager =
NSAppleEventManager.sharedAppleEventManager()
appleEventManager.setEventHandler(self, andSelector:
handleGetURLEvent:withReplyEvent:, forEventClass:
On Jun 29, 2015, at 10:13 AM, Gavin Eadie ga...@umich.edu wrote:
The problem with the callback to “after” is that “after” is just the
continuation of the program and possibly nothing to do with what happens in
“fakeSyncrony” ..
Yeah, I don’t think you have any alternative but to
On Jun 29, 2015, at 12:28 PM, Scott Ribe scott_r...@elevated-dev.com wrote:
[…] we have a counterexample in the form of the Canon ED-SDK, which somehow
does accomplish this.
I seriously doubt that. It's probably performing the work on a background
thread,
then using some callback to
On Jun 29, 2015, at 10:13 , Gavin Eadie ga...@umich.edu wrote:
I suppose the first thing “fakeSyncrony” could do is grab the address of the
next instruction and make it the address to call back to. This sounds a
little like Jens’ “crazy runtime manipulation of the stack
The mechanism you
On Jun 29, 2015, at 11:13 AM, Gavin Eadie ga...@umich.edu wrote:
The problem with the callback to “after” is that “after” is just the
continuation of the program and possibly nothing to do with what happens in
“fakeSyncrony” ..
Then why does it need to wait?
This is really sounding like
On Jun 29, 2015, at 5:53 PM, Rick Mann rm...@latencyzero.com wrote:
If you are using Swift 2.0, you can use the new `guard let` to get optional
checking without the cascade of indentation.
guard let url = NSURL(string: some url)
else { /* handle failure and either halt or return */ }
On Jun 29, 2015, at 1:19 PM, Scott Ribe scott_r...@elevated-dev.com wrote:
The problem with the callback to “after” is that “after” is just the
continuation of the program and possibly nothing to do with what happens in
“fakeSyncrony” ..
Then why does it need to wait?
This is really
On Jun 29, 2015, at 12:22 PM, Gavin Eadie ga...@umich.edu wrote:
Q: “Can anyone suggest a trick that allows an apparently synchronous call on
the main thread without impacting performance?”
The problem is that the requirement is self-contradictory: synchronous means
wait, and without
On Jun 29, 2015, at 13:50 , Gavin Eadie ga...@umich.edu wrote:
The main thread is not involved in the above, but the idea of an
“asynchronous-that-waits” == “apparently synchronous” call is demonstrated.
Yes, but you achieved that by blocking a background thread. It works because
you don’t
On Jun 29, 2015, at 15:23 , Rick Mann rm...@latencyzero.com wrote:
Oh, I think I figured it out. NSURL(string:) is optional, but
NSURLRequest(URL:) can't. Very unexpected, and the error message I was
getting did not clue me in.
-
How are you supposed to do simple things like
On Jun 29, 2015, at 15:43 , Greg Parker gpar...@apple.com wrote:
On Jun 29, 2015, at 3:18 PM, Rick Mann rm...@latencyzero.com wrote:
How are you supposed to do simple things like this, succinctly?
let url = NSURL(string: some url)
let req = NSURLRequest(URL: url)
Somewhere in this email a lightbulb gets turned on!
On Jun 29, 2015, at 2:49 PM, Scott Ribe scott_r...@elevated-dev.com wrote:
The problem is that the requirement is self-contradictory: synchronous
means wait, and without impacting performance means don't wait. While the
real requirement
On Jun 29, 2015, at 3:23 PM, Rick Mann rm...@latencyzero.com wrote:
Oh, I think I figured it out. NSURL(string:) is optional, but
NSURLRequest(URL:) can't. Very unexpected
Creating an NSURL from a string can fail, since not all strings are valid URLs.
But creating an NSURLRequest isn’t
On Jun 29, 2015, at 3:18 PM, Rick Mann rm...@latencyzero.com wrote:
How are you supposed to do simple things like this, succinctly?
let url = NSURL(string: some url)
let req = NSURLRequest(URL: url)
self.webView.loadRequest(req)
This, obviously, doesn't work, since the
Oh, I think I figured it out. NSURL(string:) is optional, but
NSURLRequest(URL:) can't. Very unexpected, and the error message I was getting
did not clue me in.
-
How are you supposed to do simple things like this, succinctly?
let url = NSURL(string: some url)
let req =
On Jun 29, 2015, at 3:42 PM, Rick Mann rm...@latencyzero.com wrote:
Here's an example (and this is what I frequently encounter) where requiring
parameter names adds nothing but clutter:
let config = WKWebViewConfiguration()
self.webView = WKWebView(frame:
How are you supposed to do simple things like this, succinctly?
let url = NSURL(string: some url)
let req = NSURLRequest(URL: url)
self.webView.loadRequest(req)
This, obviously, doesn't work, since the results are optionals, and so need to
be unwrapped. But it gets rapidly
On Jun 29, 2015, at 5:18 PM, Rick Mann rm...@latencyzero.com wrote:
But it gets rapidly ridiculous with a bunch of nested if-lets (imagine you
had more than just two operations to get from here to there).
Have you looked at Swift 2.0 yet? It addresses that forced Arrow Anti-Pattern
issue
On Jun 29, 2015, at 15:36 , Charles Srstka cocoa...@charlessoft.com wrote:
On Jun 29, 2015, at 5:18 PM, Rick Mann rm...@latencyzero.com wrote:
But it gets rapidly ridiculous with a bunch of nested if-lets (imagine you
had more than just two operations to get from here to there).
Have
On Jun 29, 2015, at 15:50 , Greg Parker gpar...@apple.com wrote:
Perhaps you would prefer a different whitespace convention, one with no
spaces around the colon in actual parameters. That's a popular convention in
Objective-C. Otherwise there is no difference between Objective-C and Swift
On Jun 29, 2015, at 15:35 , Jens Alfke j...@mooseyard.com wrote:
The unsightly nesting of the if-lets can be avoided with the nifty new
‘guard’ statement in Swift 2.
Ah, yes, that's what I should be using. Thanks!
--
Rick Mann
rm...@latencyzero.com
Here's an example (and this is what I frequently encounter) where requiring
parameter names adds nothing but clutter:
let config = WKWebViewConfiguration()
self.webView = WKWebView(frame: self.webViewContainer.frame, configuration:
config);
If Code Completion worked 100% of the time,
On Jun 29, 2015, at 2:50 PM, Gavin Eadie ga...@umich.edu wrote:
The main thread is not involved in the above, but the idea of an
“asynchronous-that-waits” == “apparently synchronous” call is demonstrated.
That's simply not asynchronous.
--
Scott Ribe
scott_r...@elevated-dev.com
On Jun 29, 2015, at 1:50 PM, Gavin Eadie ga...@umich.edu wrote:
This is all true for a “really synchronous” call, but my suggestion is that
an “apparently synchronous” call only appears to wait; using a semaphore can
stop the return, while things keep working on other threads.
I don’t
Hi there,
I am new to Apple development, and new to this list. I have two questions about
memory on OS X.
1. NSUserDefaults seems to allocate 16 MB memory at load. I can't see myself
using a megabyte—let alone 16 of those. It would be very interesting to know
why it allocates so much, and if
Hi All
I am looking at Swift 2.0. The compiler has converted the code below to the
“latest” Swift syntax. This causes the error shown. I have spent a few days
trying to get this to compile. What is confusing to me, is that the code,
listed last (func removeAnElemen…..) does compile ( all in
On Jun 28, 2015, at 23:35 , Henrik Granaas-Helmers helm...@me.com wrote:
1. NSUserDefaults seems to allocate 16 MB memory at load. I can't see myself
using a megabyte—let alone 16 of those. It would be very interesting to know
why it allocates so much, and if there is a way to encourage
On 29 Jun 2015, at 14:37, Michael de Haan m...@comcast.net wrote:
Hi All
I am looking at Swift 2.0. The compiler has converted the code below to the
“latest” Swift syntax. This causes the error shown. I have spent a few days
trying to get this to compile. What is confusing to me, is
On Jun 29, 2015, at 16:06 , Quincey Morris
quinceymor...@rivergatesoftware.com wrote:
Please stop
Nice.
--
Rick Mann
rm...@latencyzero.com
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or
On Jun 29, 2015, at 16:30 , Jens Alfke j...@mooseyard.com wrote:
On Jun 29, 2015, at 4:23 PM, Rick Mann rm...@latencyzero.com wrote:
http://pastebin.com/Q7sBWBnN
url is unwrapped already, and I'm (wrongly) trying to unwrap the
NSURLRequest. But it's not complaining about the
On Jun 29, 2015, at 15:42 , Rick Mann rm...@latencyzero.com wrote:
Here's an example (and this is what I frequently encounter) where requiring
parameter names adds nothing but clutter:
let config = WKWebViewConfiguration()
self.webView = WKWebView(frame: self.webViewContainer.frame,
On Jun 29, 2015, at 16:30 , Jens Alfke j...@mooseyard.com wrote:
The error I get with Xcode 7 beta 2 is
error: operand of postfix '?' should have optional type; type is
'NSURLRequest'
if let req = NSURLRequest(URL: url)?
~~^
So it looks like
On 30 Jun 2015, at 09:35, Rick Mann rm...@latencyzero.com wrote:
On Jun 29, 2015, at 16:30 , Jens Alfke j...@mooseyard.com wrote:
The error I get with Xcode 7 beta 2 is
error: operand of postfix '?' should have optional type; type is
'NSURLRequest'
if let req = NSURLRequest(URL:
On Jun 29, 2015, at 16:17 , Jens Alfke j...@mooseyard.com wrote:
On Jun 29, 2015, at 3:53 PM, Rick Mann rm...@latencyzero.com wrote:
The compiler's message was, Could not find an overload for 'init' that
accepts the supplied arguments. Could it instead say
NSURLRequst.init(URL:) does
On Jun 29, 2015, at 4:23 PM, Rick Mann rm...@latencyzero.com wrote:
http://pastebin.com/Q7sBWBnN http://pastebin.com/Q7sBWBnN
url is unwrapped already, and I'm (wrongly) trying to unwrap the
NSURLRequest. But it's not complaining about the arguments to
NSURLRequest.init(URL:).
After further investigation, I've discovered what code is responsible for
globally breaking scrolling my app. I have an NSScrollView subclass with the
following override:
- (void) scrollWheel:(NSEvent*)event
{
BOOL isScrollEnclosing = // YES if the receiver has scrolled to its
very
48 matches
Mail list logo