Re: How to recognize mutability?

2013-02-22 Thread Keith J. Schultz
Hi Everybody, I step in here, with my two euro cents worth. I see a basic design flaw happening here. That is you do not to be doing consistency checks. It is possible to find out if something goes wrong during the arching process. Check the API for NSKeyedArchiver. Maybe, I am to old school, b

Re: A plugin for a sandboxed app - where to can I successfully store a temp file?

2013-02-22 Thread Mike Abdullah
On 22 Feb 2013, at 01:34, Nick wrote: > Hello. > I am working on a plugin for Mail.app for Mountain Lion. The problem is > whenever I try to save a file, I am getting an error. Which can be > explained by the fact that Mail.app is sandboxed and I am not allowed to > modify files anywhere on the s

[OT] Sync vs ASync Server Comms

2013-02-22 Thread Dave
Hi All, I was reading an article about Server/Client communications using a Rest service and the author seemed to have a downer on using the Sync (as opposed to ASync) methods of making a request and receiving a reply. Also I've noticed it being generally discouraged in quite a few other

Re: A plugin for a sandboxed app - where to can I successfully store a temp file?

2013-02-22 Thread Nick
>Why should Mail "obviously should have access to this directory”? Because Mail stores attachments to that folder. >You’re not consulting/logging the error message for a start . That will tell you *why* it fails There's not much to log. The path to a file i generate is (i - is a number): NSStri

Re: [OT] Sync vs ASync Server Comms

2013-02-22 Thread Uli Kusterer
Hi, in short: Network processes can take a long time (high traffic, 14.4k modems, ...). If you are using a synchronous call on the main thread, your application will be completely blocked from doing anything else. The CPU will sit there idle, not doing anything until the transfer has finished.

Re: A plugin for a sandboxed app - where to can I successfully store a temp file?

2013-02-22 Thread Uli Kusterer
He meant the error return parameter to the URLForDirectory call. You're passing NULL. Why not pass it an NSError* and NSLog() the object it gives you back when it returns NIL (which it presumably does?) Also, is there any output on the console? If it's the sandbox, there's usually a log message

Re: A plugin for a sandboxed app - where to can I successfully store a temp file?

2013-02-22 Thread Nick
Uli, there's no error. URLForDirectory returns the directory path (something like /private/var/folders/WM/(com.apple.mail)/Downloads on both working and non-working systems. No output to the console either. 2013/2/22 Uli Kusterer > He meant the error return parameter to the URLForDirectory

Re: [OT] Sync vs ASync Server Comms

2013-02-22 Thread Dave
Hi, Hi, On 22 Feb 2013, at 11:29, Uli Kusterer wrote: in short: Network processes can take a long time (high traffic, 14.4k modems, ...). If you are using a synchronous call on the main thread, your application will be completely blocked from doing anything else. The CPU will sit ther

iOS books, etc for experienced OSX programmers

2013-02-22 Thread Koen van der Drift
Having a lot of knowledge of and experience with Cocoa/ObjC/OSX I am looking for a good introduction to making iOS apps. Starting at Apple's dev website I did the BirdWatching tutorial. When searching for books, two jump out: the ones by Hillegass and by Dudney. However, based on their table of con

Re: [OT] Sync vs ASync Server Comms

2013-02-22 Thread Uli Kusterer
performSelector doesn't take care of locking non-threadsafe data structures, avoiding deadlocks in aforementioned logs etc. Although e.g. Cocoa's UI classes have improved a lot WRT thread-safety in recent MacOS releases, it's still not safe to drive arbitrary controls from another thread. Simila

Re: iOS books, etc for experienced OSX programmers

2013-02-22 Thread Roland King
With respect to Mssrs Hillegass and Dudney, if you have a good knowledge of OSX Cocoa I think you are probably going to do as well jumping in and reading what docs and sample code Apple has trying to convert your brain to iOS. My experience, going the other way, is that the iOS interface is clea

Re: iOS books, etc for experienced OSX programmers

2013-02-22 Thread Koen van der Drift
Good advice, thanks Roland. I do have an idea and a project, so I will just go ahead and dive in. One thing I'm not sure about yet is the use of 'storyboards'. Apple uses it in their tutorial, but the two books I mentioned seem to hardly touch on it. Maybe it is too new to have been included intho

Re: [OT] Sync vs ASync Server Comms

2013-02-22 Thread Dave
On 22 Feb 2013, at 13:57, Uli Kusterer wrote: performSelector doesn't take care of locking non-threadsafe data structures, avoiding deadlocks in aforementioned logs etc. Although e.g. Cocoa's UI classes have improved a lot WRT thread-safety in recent MacOS releases, it's still not safe to

Re: Tracking object references

2013-02-22 Thread Matt Neuburg
On Sun, 17 Feb 2013 12:16:47 -0600, Ken Thomases said: >On Feb 17, 2013, at 11:50 AM, Matt Neuburg wrote: > >> On Sat, 12 Jan 2013 11:13:13 +, Mike Abdullah >> said: >>> >>> The allocations instrument can show you all presently allocated objects. >>> Find the object(s) you're interested in

Re: IOS iPad PopOver Nav bar color

2013-02-22 Thread Matt Neuburg
On Sun, 17 Feb 2013 17:24:25 -0800, Trygve Inda said: >I have a popover view and would like a nav-like title bar on it in a dark >color that matches the frame gradient of the popover fram. I can make the >nav bar grey or black, but can't seem to get it to apply the gradient that >the frame has. S

Re: [OT] Sync vs ASync Server Comms

2013-02-22 Thread Fritz Anderson
On 22 Feb 2013, at 8:56 AM, Dave wrote: > A (Background) thread has two choices at this stage: > > 1. Call aSyncComputePIToAZillionPlacesWithDelegate and provide a delegate > that will be called back with the result. > > 2. Call syncComputePIToAZillionPlaces get the result inline. > > As lo

Re: iOS books, etc for experienced OSX programmers

2013-02-22 Thread Matt Neuburg
On Fri, 22 Feb 2013 22:16:11 +0800, Roland King said: >I like the stuff Matt Neuburg publishes, I admit to reading that which he's >made publicly available without purchasing the book (sorry Matt) No apologies needed. I posted it so you could read it. (Of course I'd *like* to be rewarded if my

Re: A plugin for a sandboxed app - where to can I successfully store a temp file?

2013-02-22 Thread Kyle Sluder
On Fri, Feb 22, 2013, at 04:40 AM, Nick wrote: > Uli, > there's no error. URLForDirectory returns the directory path (something > like /private/var/folders/WM/(com.apple.mail)/Downloads > on both working and non-working systems. > No output to the console either. Mail plugins are not supporte

Re: [OT] Sync vs ASync Server Comms

2013-02-22 Thread Dave
On 22 Feb 2013, at 15:48, Fritz Anderson wrote: On 22 Feb 2013, at 8:56 AM, Dave wrote: A (Background) thread has two choices at this stage: 1. Call aSyncComputePIToAZillionPlacesWithDelegate and provide a delegate that will be called back with the result. 2. Call syncComputePIToAZill

Re: NSPipe eating up all available pipes on system.

2013-02-22 Thread Willeke
I don't know why but it doesn't leak if you do readInBackgroundAndNotify only if [data length]!=0. - Willeke Op 20 feb 2013, om 23:56 heeft Mr. Gecko het volgende geschreven: > Looks like every pipe is leaking. I cannot see a way to prevent the leak > myself as I know the NSPipes are being r

Re: [OT] Sync vs ASync Server Comms

2013-02-22 Thread Alex Zavatone
Well, one reason on iOS is that it will happen on thread 1 and block the main thread which is also the thread that the GUI is handled on. Sent from my iPad On Feb 22, 2013, at 5:13 AM, Dave wrote: > Hi All, > > I was reading an article about Server/Client communications using a Rest > servic

Re: [OT] Sync vs ASync Server Comms

2013-02-22 Thread Quincey Morris
On Feb 22, 2013, at 08:32 , Dave wrote: > As long as you are not running on the main thread there is no real difference > between a Sync or ASync operation as far as any of the issues you mention > above are concerned. You're correct that, at some level, using synchronous methods on a backgrou

Re: iOS books, etc for experienced OSX programmers

2013-02-22 Thread David Rowland
I like Matt Neuburg's book, and I recommend it to iOS classes I teach. Its first person style suits me, and I turn to it for answers and often find something extra. However, it is dense and not for everyone. Some of my students wish there were more examples, but Neuburg explicitly avoids HelloWo

Re: iOS books, etc for experienced OSX programmers

2013-02-22 Thread Alex Zavatone
FYI, in looking for material to use, from my experience, it is also important to know what to avoid. Ignore anything that is older than two years and any older material that references any version of Xcode before 4. A lot of the books that I do buy, (Matt's, Erica's, Vandad Nahavandipoor's

Re: Tracking object references

2013-02-22 Thread Ken Thomases
On Feb 22, 2013, at 9:42 AM, Matt Neuburg wrote: > On Sun, 17 Feb 2013 12:16:47 -0600, Ken Thomases said: >> On Feb 17, 2013, at 11:50 AM, Matt Neuburg wrote: >> >>> On Sat, 12 Jan 2013 11:13:13 +, Mike Abdullah >>> said: The allocations instrument can show you all presently all

Re: IOS iPad PopOver Nav bar color

2013-02-22 Thread Alex Zavatone
I just came across this the other day. You can crack open AI or PS and draw your own and replace the graphic which is a great skill to learn. http://layersmagazine.com/designing-ios-tab-and-navigation-bars-in-photoshop.html Then use this: if ([self.navigationController.navigationBar respondsT

Re: Tracking object references

2013-02-22 Thread Greg Parker
On Feb 22, 2013, at 7:42 AM, Matt Neuburg wrote: > Some specific object did send "retain". It is that specific object's > responsibility eventually to send "release". That's how Cocoa memory > management works. Instruments *can* know, and *should* tell me, what specific > object that is. I woul

Re: iOS books, etc for experienced OSX programmers

2013-02-22 Thread Koen van der Drift
Thanks everyone for the helpful info. Highly appreciated! - Koen. On Fri, Feb 22, 2013 at 1:55 PM, Alex Zavatone wrote: > FYI, in looking for material to use, from my experience, it is also > important to know what to avoid. > > Ignore anything that is older than two years and any older material

Re: [OT] Sync vs ASync Server Comms

2013-02-22 Thread Jens Alfke
On Feb 22, 2013, at 8:32 AM, Dave wrote: > Of course there are threading "issues" Having delegates doesn't stop that There are no threading issues if you don’t create background threads. I’ve written a lot of code that does network access using the async APIs, and most of it didn’t requir

Re: Tracking object references

2013-02-22 Thread Jean Suisse
I am not taking any sides here, but rather just interested in the topic at hand : Tracking object references. I had met an issue once that I never solved, which did require me to track down retain / release calls. What I did was to find in my code every explicit or implicit (@property accessors

Re: NSPipe eating up all available pipes on system.

2013-02-22 Thread Mr. Gecko
Doesn't make sense as when you release the NSPipe, it should disable that. I will report this to apple via Rdar. Thanks for solving my issue! On Feb 22, 2013, at 10:47 AM, Willeke wrote: > I don't know why but it doesn't leak if you do readInBackgroundAndNotify only > if [data length]!=0. >

Re: NSPipe eating up all available pipes on system.

2013-02-22 Thread Ken Thomases
On Feb 22, 2013, at 5:52 PM, Mr. Gecko wrote: > On Feb 22, 2013, at 10:47 AM, Willeke wrote: > >> I don't know why but it doesn't leak if you do readInBackgroundAndNotify >> only if [data length]!=0. > > Doesn't make sense as when you release the NSPipe, it should disable that. I > will repor