What about QLSeamlessDocumentOpener

2012-11-25 Thread Gerriet M. Denkmann
What does this mean? What can I do to get rid of these warnings?

 [QL] QLError(): -[QLSeamlessDocumentOpener showWindow:contentFrame:withBlock:] 
should only be called in the main thread
CoreAnimation: warning, deleted thread with uncommitted CATransaction; created 
by:
0   QuartzCore  0x7fff8db81b95 
_ZN2CA11Transaction4pushEv + 219
1   QuartzCore  0x7fff8db8176d 
_ZN2CA11Transaction15ensure_implicitEv + 273
2   QuartzCore  0x7fff8db8160a 
_ZN2CA11Transaction9set_valueEj12_CAValueTypePKv + 40
3   QuartzCore  0x7fff8db8159e +[CATransaction 
setDisableActions:] + 38
4   AppKit  0x7fff968fef6e -[NSScrollerImp 
_updateLayerGeometry] + 67
5   AppKit  0x7fff968fe54d 
-[NSScroller(NSInternal2) _replaceScrollerImp] + 368
6   AppKit  0x7fff96996828 -[NSScroller 
initWithCoder:] + 305
7   Foundation  0x7fff8caa0a09 _decodeObjectBinary 
+ 2741
8   Foundation  0x7fff8caa17e6 -[NSKeyedUnarchiver 
_decodeArrayOfObjectsForKey:] + 1189
9   Foundation  0x7fff8caa1d58 -[NSArray(NSArray) 
initWithCoder:] + 538
10  Foundation  0x7fff8caa0a09 _decodeObjectBinary 
+ 2741
11  Foundation  0x7fff8ca9fdb4 _decodeObject + 226
12  AppKit  0x7fff968186e1 -[NSView 
initWithCoder:] + 976
13  AppKit  0x7fff96993dc7 -[NSScrollView 
initWithCoder:] + 335
14  Foundation  0x7fff8caa0a09 _decodeObjectBinary 
+ 2741
15  Foundation  0x7fff8ca9fdb4 _decodeObject + 226

10.8.2
Xcode 4.5.2

And I do not have any ScrollViews in my app.

My app delegate observes operationCount of my operationQueue and when this  
operationCount becomes zero (i.e. when the work has been done), I open a new 
document (openUntitledDocumentAndDisplay:error:).

When I comment this call out, the warning goes away.

But why is this thing complaining about not running in the main thread?
Rather confusing.

Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What about QLSeamlessDocumentOpener

2012-11-25 Thread Graham Cox

On 25/11/2012, at 10:21 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:

 What does this mean? What can I do to get rid of these warnings?

Short answer: don't call -openUntitledDocument... on a thread other than main.

 [QL] QLError(): -[QLSeamlessDocumentOpener 
 showWindow:contentFrame:withBlock:] should only be called in the main thread
 CoreAnimation: warning, deleted thread with uncommitted CATransaction; 
 created by:
 0   QuartzCore  0x7fff8db81b95 
 _ZN2CA11Transaction4pushEv + 219
 1   QuartzCore  0x7fff8db8176d 
 _ZN2CA11Transaction15ensure_implicitEv + 273
 2   QuartzCore  0x7fff8db8160a 
 _ZN2CA11Transaction9set_valueEj12_CAValueTypePKv + 40
 3   QuartzCore  0x7fff8db8159e +[CATransaction 
 setDisableActions:] + 38
 4   AppKit  0x7fff968fef6e -[NSScrollerImp 
 _updateLayerGeometry] + 67
 5   AppKit  0x7fff968fe54d 
 -[NSScroller(NSInternal2) _replaceScrollerImp] + 368
 6   AppKit  0x7fff96996828 -[NSScroller 
 initWithCoder:] + 305
 7   Foundation  0x7fff8caa0a09 
 _decodeObjectBinary + 2741
 8   Foundation  0x7fff8caa17e6 
 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1189
 9   Foundation  0x7fff8caa1d58 -[NSArray(NSArray) 
 initWithCoder:] + 538
 10  Foundation  0x7fff8caa0a09 
 _decodeObjectBinary + 2741
 11  Foundation  0x7fff8ca9fdb4 _decodeObject + 226
 12  AppKit  0x7fff968186e1 -[NSView 
 initWithCoder:] + 976
 13  AppKit  0x7fff96993dc7 -[NSScrollView 
 initWithCoder:] + 335
 14  Foundation  0x7fff8caa0a09 
 _decodeObjectBinary + 2741
 15  Foundation  0x7fff8ca9fdb4 _decodeObject + 226
 
 10.8.2
 Xcode 4.5.2
 
 And I do not have any ScrollViews in my app.
 
 My app delegate observes operationCount of my operationQueue and when this  
 operationCount becomes zero (i.e. when the work has been done), I open a new 
 document (openUntitledDocumentAndDisplay:error:).

 
 When I comment this call out, the warning goes away.
 
 But why is this thing complaining about not running in the main thread?
 Rather confusing.


Because the observation is on another thread, so when the observer is 
triggered, it's still on the operation queue's thread. Invoke the document 
opening request on the main thread and you'll be fine.

--Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


dispatch queues are objects now .. right?

2012-11-25 Thread Roland King
I'm pretty sure that when I was watching the WWDC 2012 sessions, dispatch 
queues are now objects (since iOS6 and OS 10.7/10.8?) and as such I don't have 
to dispatch_retain() or release them and can just use them like any other 
object. But I can't find a reference in the documentation which supports that, 
that still says dispatch_queue_t is a struct. 

I wandered around the header files a bit but they conflict with each other. The 
header file (queue.h) says they are reference counted via calls to 
dispatch_retain() .. but the OS_OBJECT_DECL() macro says something rather 
different, that they are objects and the trail goes cold there. 

Am I correct in what I remember, are they now NSSObjects? 

if there isn't one by the way, this would really make an ideal technote. There 
was lots of information in the 2010, 2011 and 2012 WWDC videos and each year 
things changed, which is part of my confusion, I've been watching some of the 
older videos I never saw before, 2 pages akin to the 'Transitioning to ARC' 
notes would really help here, saying what dispatch queues and similar do in 
various version of the OS and what you need to do with them (there was 
something about cancelling .. something .. to avoid reference cycles .. I'm 
going to have to watch the vids for a 3rd time). If there is such a technote, 
my search didn't find it. 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What about QLSeamlessDocumentOpener

2012-11-25 Thread Gerriet M. Denkmann

On 25 Nov 2012, at 19:21, Graham Cox graham@bigpond.com wrote:

 
 On 25/11/2012, at 10:21 PM, Gerriet M. Denkmann gerr...@mdenkmann.de 
 wrote:
 
 What does this mean? What can I do to get rid of these warnings?
 
 Short answer: don't call -openUntitledDocument... on a thread other than main.
 
You are right. I replaced:
 [ self makeNewDocument] with:
[ self performSelectorOnMainThread: @selector(makeNewDocument)  withObject: nil 
 waitUntilDone: NO ];
and all is fine.

And indeed:
NSLog(@%s isMainThread %u,__FUNCTION__, [NSThread  isMainThread]);// 
prints 0

Thanks a lot.

Kind regards,

Gerriet.





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSFileManager - Incompatible persistent store

2012-11-25 Thread Tom Miller
Hey Sean,

Thank you! Though this didn't quite work. I'm getting an error response in
the code telling me No visible @interface for 'NSFileManger' declares the
selector 'createDirectoryAtURL:attributes'. Included in this message is the
code im playing with,
https://dl.dropbox.com/u/3783094/BlogDemoAppDelegate.m
https://dl.dropbox.com/u/3783094/BlogDemoAppDelegate.m



On Thu, Nov 22, 2012 at 10:58 AM, Sean McBride s...@rogue-research.comwrote:

 On Wed, 21 Nov 2012 18:17:26 -0500, Tom Miller said:

 Sorry my bad! The warning states 'createDirectoryAtPath:attributes:' is
 depreciated. I was able to get rid of that window warning once the app
 launched, miss spelled something in my code. Though I'm still unable to
 save the imputed text to the XML. I can provide the entire set of code if
 needed to.

 Tom,

 Most path-based and non-NSError-returning file APIs are deprecated, and
 you should use URL+NSError methods instead:

 createDirectoryAtURL:withIntermediateDirectories:attributes:error:

 Also, using fileExistsAtPath: is rarely the right thing due to race
 conditions: it's possible the file didn't exist when you checked, then gets
 created by a different process before you get to create it.  Instead, just
 try to create it, and be ready for a returned error like 'already exists'.
  See:

 
 https://developer.apple.com/library/mac/#documentation/security/conceptual/SecureCodingGuide/Articles/RaceConditions.html
 

 Cheers,

 --
 
 Sean McBride, B. Eng s...@rogue-research.com
 Rogue Researchwww.rogue-research.com
 Mac Software Developer  Montréal, Québec, Canada





-- 
-
Tom Miller
t...@pxlc.me
pxlc.me
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: dispatch queues are objects now .. right?

2012-11-25 Thread Mike Abdullah

On 25 Nov 2012, at 13:38, Roland King r...@rols.org wrote:

 I'm pretty sure that when I was watching the WWDC 2012 sessions, dispatch 
 queues are now objects (since iOS6 and OS 10.7/10.8?) and as such I don't 
 have to dispatch_retain() or release them and can just use them like any 
 other object. But I can't find a reference in the documentation which 
 supports that, that still says dispatch_queue_t is a struct. 
 
 I wandered around the header files a bit but they conflict with each other. 
 The header file (queue.h) says they are reference counted via calls to 
 dispatch_retain() .. but the OS_OBJECT_DECL() macro says something rather 
 different, that they are objects and the trail goes cold there. 
 
 Am I correct in what I remember, are they now NSSObjects? 

They are objective-C objects, which doesn't necessarily mean they inherit from 
NSObject. If you have a deployment target of 10.8 or iOS 6 then ARC is able to 
manage their lifecycle for you.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSFileManager - Incompatible persistent store

2012-11-25 Thread Graham Cox

On 26/11/2012, at 9:44 AM, Tom Miller t...@pxlc.me wrote:

 Thank you! Though this didn't quite work. I'm getting an error response in
 the code telling me No visible @interface for 'NSFileManger' declares the
 selector 'createDirectoryAtURL:attributes'. Included in this message is the
 code im playing with,


So, have you actually tried Sean's suggestion of using 
-createDirectoryAtURL:withIntermediateDirectories:attributes:error: ? You 
should also make your method -applicationSupportFolder return a NSURL not a 
path string.

There's no good reason for new code to be using a deprecated method, and 
sticking with paths instead of URLs is not a good long-term strategy. I've just 
spent a lot of time moving a bunch of older code from path strings to URLs and 
it's a lot of work, so unless you have to support a much older version of OS X, 
use NSURL now.

Also, as suggested, checking for the existence of the folder before trying to 
create it is considered a bad design pattern these days - the method will 
create the directory IF NECESSARY, and if not (i.e. it exists already) will 
gracefully return without error.


--Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Tooltip with Custom bg color/image and text color

2012-11-25 Thread Appa Rao Mulpuri
We are using the attached window concept where we need to display help
info upon button click.  I think we need to create Tracking rect and start
the timer upon mouse entered into that rect and display the attached
window after sometime to mimic the Tooltip behavior.

I am just checking instead of doing all that own, can't we override the
existing tooltip view with my view?

Regards,
Apparao Mulpuri




On 24/11/12 3:40 AM, Jerry Krinock je...@ieee.org wrote:


On 2012 Nov 22, at 02:12, Appa Rao Mulpuri appar...@ivycomptech.com
wrote:

 I may need to display an email in the tooltip.

Don't use a bicycle if you need a truck.  In this case, make your own
custom attached window.  It's not difficult.  Read thisŠ

http://mattgemmell.com/2007/10/03/maattachedwindow-nswindow-subclass/


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/apparaom%40ivycomptech.c
om

This email sent to appar...@ivycomptech.com

This email and any attachments are confidential, and may be legally privileged 
and protected by copyright. If you are not the intended recipient dissemination 
or copying of this email is prohibited. If you have received this in error, 
please notify the sender by replying by email and then delete the email 
completely from your system. Any views or opinions are solely those of the 
sender. This communication is not intended to form a binding contract unless 
expressly indicated to the contrary and properly authorised. Any actions taken 
on the basis of this email are at the recipient's own risk.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com