NSTextView HICocoaView performance

2009-04-09 Thread Ryan Joseph
I was really excited when Apple released HICocoaView so in particular  
I could use NSTextView in my Carbon apps. However, this thing has some  
pretty serious performance issue when resizing and when adding/ 
removing lines (return or deleting while type). Resizing is painfully  
slow and choppy but the real issue is typing return which causes  
delays, very annoying. Has anyone noticed this (maybe it's just my  
code?) and knows of a fix? I'm thinking this could be partially  
related to NSScrollView as both the operations involve scrolling.  
Honestly I'm surprised this made it to release with this kind of  
performance blunder. Any suggestions are greatly appreciated. Thanks.


Regards,
Josef

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


navigate in and around xib files

2009-04-09 Thread developers mac
Hi there,
 I used the code below to navigate between UITableViewController.

SearchAthleteNameViewController *searchAthletesVC =
[[[SearchAthleteNameViewController alloc] initWithNibName:storyLink
bundle:nil] autorelease];

[self.navigationController pushViewController:searchAthletesVC
animated:YES];


Where SearchAthleteNameViewController is an instance of another
UItableViewController (another .xib file).


Now, I have to navigate to NSObject from an UItableViewController. I tried
using the same, i cannot find the method, initwithNibName to make it
navigate. And also it shows an warning in the next line & a cfrunloop
prevails.


can some one suggest/send sample code for me to make it run? Please!
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: IKImageBrowserView crash

2009-04-09 Thread jonat...@mugginsoft.com

I don't have a solution just a couple of suggestions.

As GC is enabled you can try temporarily disabling the collector.
Bracket the crashing code segment with:

[[NSGarbageCollector defaultCollector] disable];

// crashing code

[[NSGarbageCollector defaultCollector] enable];

Otherwise I can only suggest extracting the essentials of your code  
into a test project.

If the problem can be replicated there then repost with more detail

On 8 Apr 2009, at 20:36, Ashley Clark wrote:

I'm using an IKImageBrowserView to show sets of PDF documents in my  
program and am occasionally seeing crashes during IKImageWrapper  
finalize calls. The crash log shows absolutely none of my code at  
all. This typically happens when someone is adding a document to the  
image browser's datasource.


Has anyone seen these types of crashes and have any idea if there's  
a way for me to resolve it?


Thanks,
Ashley


Here's a few relevant bits from the crash log:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x1d05e0b0
Crashed Thread:  0

Application Specific Information:
objc[6119]: garbage collection is ON
IKImageWrapper

Thread 0 Crashed:
0   GLEngine0x1e4daf17  
glDeleteTextures_Exec + 23
1   libGL.dylib 0x941cc476 glDeleteTextures  
+ 38
2   com.apple.imageKit  0x93aa4684  
_deleteTextureForIKGLImageInfo + 105

3   com.apple.imageKit  0x93aa46da _removeOwners + 53
4   com.apple.CoreFoundation0x942bcb29  
CFDictionaryApplyFunction + 169
5   com.apple.imageKit  0x93aa528a - 
[IKGLSharedContextRegistry removeOwner:] + 141

6   com.apple.CoreFoundation0x9436ba3d __invoking___ + 29
...

Thread 1:
0   libSystem.B.dylib   0x956be3ae __semwait_signal  
+ 10
1   libSystem.B.dylib   0x956e8d0d pthread_cond_wait 
$UNIX2003 + 73
2   com.apple.Foundation0x902532d2 -[NSCondition  
wait] + 210
3   com.apple.Foundation0x9020bc6a - 
[NSObject(NSThreadPerformAdditions)  
performSelector:onThread:withObject:waitUntilDone:modes:] + 938
4   com.apple.Foundation0x9028c76c - 
[NSObject(NSThreadPerformAdditions)  
performSelectorOnMainThread:withObject:waitUntilDone:modes:] + 92
5   com.apple.imageKit  0x939c4bcd -[_IKIRLMainProxy  
forwardInvocation:] + 121
6   com.apple.CoreFoundation0x9436b96a ___forwarding___  
+ 986
7   com.apple.CoreFoundation0x9436b9d2  
_CF_forwarding_prep_0 + 50
8   com.apple.imageKit  0x939b6e7e -[IKImageWrapper  
finalize] + 81
9   libobjc.A.dylib 0x94ab46b6 finalizeOneObject  
+ 56

...

Thread 4:
0   com.apple.AppKit0x905fe758 _NSReadImage + 4633
1   com.apple.AppKit0x905fd3de - 
[NSBitmapImageRep initWithFocusedViewRect:] + 187
2   com.apple.imageKit  0x939bd4ec  
IKCGImageFromNSImage + 550
3   com.apple.imageKit  0x939bca32 -[IKImageWrapper  
_tryToCreateCGImageRepFromNonCGFile:] + 125
4   com.apple.imageKit  0x939bc4d1 -[IKImageWrapper  
_thumbnailWithSize:antialiased:qualityRequested:qualityProduced:] +  
264
5   com.apple.imageKit  0x939c2bb1 -[IKMipmapItem  
setAsMipmapOfImage:withSize:antialiased:quality:] + 111
6   com.apple.imageKit  0x939c2e94 -[IKMipmapItem  
setAsMipmapOfImage:aspectRatio:antialiased:quality:] + 355
7   com.apple.imageKit  0x939c05e1 -[IKMipmapImage  
validateMipmap:withModel:withQuality:] + 350
8   com.apple.imageKit  0x939c0776 -[IKMipmapImage  
validateMipmap:withQuality:] + 228
9   com.apple.imageKit  0x939e2b1a - 
[IKImageBrowserView(ImageBrowserImport) startScrollPrefetchTask] +  
1040
10  com.apple.imageKit  0x93a92167 -[IKTaskManager  
taskLoop] + 2037

...

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Send click to window

2009-04-09 Thread Benjamin Mollenhauer

Hi!

Is it possible to send a simulated mouse click to a specific window,  
overlapped by others?


The application i want to automate as no AXActions other than AXRaise  
for the main window.
I already tried to focus the window and then click (via  
CGPostMouseEvent), but this interferes with user interaction.


Thanks.

Benjamin
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Send click to window

2009-04-09 Thread Benjamin Mollenhauer

Is it possible to send a simulated mouse click to a specific window,
overlapped by others?



Benjamin - Have you tried creating your custom NSEvent objects and  
passing

them to NSApplication's -sendEvent:?


Thanks for your quick answer. Maybe I was not specific enough:
I want to control windows from foreign applications.
Hence i tired it with the Accessibility API.

Benjamin
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: navigate in and around xib files

2009-04-09 Thread Alexander Spohr


Am 09.04.2009 um 10:54 schrieb developers mac:

Now, I have to navigate to NSObject from an UItableViewController. I  
tried

using the same, i cannot find the method, initwithNibName to make it
navigate. And also it shows an warning in the next line & a cfrunloop
prevails.

can some one suggest/send sample code for me to make it run? Please!


No we can not. You can not navigate to an NSObject. You need an  
UIViewController-subclass.

Read and understand the docs about UIViewController.

atze

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Send click to window

2009-04-09 Thread Dave Keck
> I quickly tested CGEventPostToPSN() and was able to click Safari's
> menu bar from my test app, but was not able to click inside Safari's.

Sorry, that was meant to say:

...but was not able to click inside Safari's windows.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: removeFromSuperview and mouse events

2009-04-09 Thread Alexander Spohr

Try setSubviews:
Just get the subviews, sort then and setSubviews:

Documentation:
„And any views that are in both subviews and newSubviews are moved in  
the subviews array as needed, without being removed and re-added.“


atze


Am 08.04.2009 um 23:26 schrieb Joshua Strickon:

I have a project in which I am adding nsbox controls as a subviews  
to the main nsview.  As a test, I do this on a rightmousedown. I  
then use the leftmousedown to select and move the boxes around.   
This all works fine.  The problem I am having is that I would like  
the selected object to be drawn at the top when selected.  I figured  
I could do this by removing it from the superview and readding it.


If I make any call to removeFromSuperview during the mousedown event  
I don't any additional mousedragged or mouse up events.


I have tried retaining the subview, forcing it not to redraw and more.

What is the best way to programatically set and change subviews so  
you can control the drawing order?  Where are these missing events  
going?


Thanks


Josh
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/atze%40freeport.de

This email sent to a...@freeport.de


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Send click to window

2009-04-09 Thread Kyle Sluder
On Thu, Apr 9, 2009 at 6:50 AM, Benjamin Mollenhauer
 wrote:
> Thanks for your quick answer. Maybe I was not specific enough:
> I want to control windows from foreign applications.
> Hence i tired it with the Accessibility API.

You can only do this with the accessibility API.  By default this is
turned off, so no, there is no general way for you to send events to
another application.

--Kyle Sluder
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Send click to window

2009-04-09 Thread Dave Keck
> Is it possible to send a simulated mouse click to a specific window,
> overlapped by others?

CGEventPostToPSN() is what you want - but unfortunately it looks like
a little hackery will be involved to get it working. NSEvent has a
'windowNumber' property associated with it, but it doesn't look like
CGEvent has anything like that. (Although, I suspect it might, but
that value isn't part of the public API.)

I quickly tested CGEventPostToPSN() and was able to click Safari's
menu bar from my test app, but was not able to click inside Safari's.

I would try converting an NSEvent to a CGEvent (using NSEvent's
-eventRef method). Set the NSEvent's window number in its initializer,
and, with a little luck the windowNumber might find its way into the
CGEvent after the conversion. Again, this assumes CGEvent tracks
windowNumber in the first place, which there's no evidence that it
does.

Also, check out CGEventField. I searched it up and down for something
like kCGEventWindowNumber but, alas, it ain't there. So yeah, maybe
it's part of the private API...

At any rate, if you have trouble getting it working, which looks
likely, try asking about CGEventPostToPSN() on a quartz-dev or
something.

Good luck (and keep us posted!),

David
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


removeFromSuperview and mouse events

2009-04-09 Thread Joshua Strickon
I have a project in which I am adding nsbox controls as a subviews to  
the main nsview.  As a test, I do this on a rightmousedown. I then use  
the leftmousedown to select and move the boxes around.  This all works  
fine.  The problem I am having is that I would like the selected  
object to be drawn at the top when selected.  I figured I could do  
this by removing it from the superview and readding it.


If I make any call to removeFromSuperview during the mousedown event I  
don't any additional mousedragged or mouse up events.


I have tried retaining the subview, forcing it not to redraw and more.

What is the best way to programatically set and change subviews so you  
can control the drawing order?  Where are these missing events going?


Thanks


Josh
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Send click to window

2009-04-09 Thread Luca C.
2009/4/9 Benjamin Mollenhauer 

> Hi!
>
> Is it possible to send a simulated mouse click to a specific window,
> overlapped by others?


Benjamin - Have you tried creating your custom NSEvent objects and passing
them to NSApplication's -sendEvent:?

 NSEvent class reference
<
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/nsevent_Class/Reference/Reference.html
>

 NSApplication sendEvent:
<
http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/NSApplication/sendEvent
:>



--Luca C.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Send click to window

2009-04-09 Thread Kyle Sluder
Ah, for some reason I interpreted your message as wanting to send
arbitrary messages to objects in another process.  My mistake.

--Kyle Sluder
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


find out where is a key equivalent assigned

2009-04-09 Thread Georg Seifert

Hello,

I have a old project with a big nib file and it seems that somewhere  
is a key equivalent defined for "ctrl+left cursor key". If I press  
"ctrl+left cursor key" nothing happend (option+left and everything  
else works fine).


I even tried subclassing NSApplication to track the event handling but  
with no success. I get the keypress event in NSApplication sendEvent:  
and in NSWindow sendEvent: but nothing more.


How do I find out where the event goes after this?

Many thanks
Georg




:::
Georg Seifert
type and graphic design

new: schriftgestaltung.de






___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Using authorization to enumerate restricted folders?

2009-04-09 Thread Oleg Krupnov
I want to programmatically enumerate files within a folder with
restricted access (such as home folder of another user), similar to
using sudo command in Terminal.

I have read the "Performing Privileged Operations With Authorization
Services" guide and I have written the code that creates the
authorization reference and shows the dialog for entering the admin
password.

Now I am puzzled what do I do next? How do I use this authorization
reference, how do I pass it to the file manipulation functions?

I tried to enumerate the restricted folders, but I keep getting the
permission denied error.

Thanks!
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Storing bundle loaded main class instances in NSArray

2009-04-09 Thread Daniel Luis dos Santos

Summarizing the behaviour I see here

If I add an object (which is the principal class of  a bundle) to an  
NSMutableArray, later in the program I get the exception that the  
NSFileManager default manager object does not respond to a known  
message selector.
I further narrowed it down to a fread call (standard libc) that I do  
just before the exception is thrown. If I comment the fread the error  
appears at another point in the code when I am initializing a  
NSDictionary with dictionaryWithDictionary. That other error shows  
itself in the gdb log as a pointer  modified after being freed.


Since this error is a bit difficult to track and explain through  
emails, I appreciate all your help, and think I will try to debug some  
more (change the code to some other way of doing it).


Thanks anyway


On Apr 9, 2009, at 1:38 AM, Graham Cox wrote:



On 09/04/2009, at 2:13 AM, Daniel Luis dos Santos wrote:

I expect a file manager and it tells me that it does not respond to  
fileExistsAtPath



No you don't.

According to your original post, you are complaining that calling - 
addObject on _instances throws this error. So does _instances point  
to NSFileManager or an array, as the code implies?


You're confused, so the rest of us have no chance.

Regarding your comments about autorelease pools, sounds like you're  
relying on some assumed behaviour that is not stated anywhere in any  
documentation. Don't do that, you're just creating problems that  
don't need to be there. What about the autorelease pools created  
around the main event loop for example?


--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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


HUD-Style buttons

2009-04-09 Thread Walker Argendeli
I think I'm missing something obvious here.  I have a HUD window that  
I need buttons in.  The button style that looks closest to what I want  
is recessed, but that's not exactly what I'd like.  See, that way,  
there's no border, and the text is black unless the button is  
selected.  What I'd like is something like the round rect button in  
HUD style.  In other words, there's a border around it, it's obviously  
a button, and the text is always white.  I've seen examples of this  
before (the most recent that comes to mind is in AppShelf's details  
window, but I can't figure out how to do it.


Thanks,
- Walker Argendeli

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: HUD-Style buttons

2009-04-09 Thread jonat...@mugginsoft.com

Check out the BWToolkit.
http://www.brandonwalkin.com/blog/2008/11/13/introducing-bwtoolkit/

On 9 Apr 2009, at 15:08, Walker Argendeli wrote:

I think I'm missing something obvious here.  I have a HUD window  
that I need buttons in.  The button style that looks closest to what  
I want is recessed, but that's not exactly what I'd like.  See, that  
way, there's no border, and the text is black unless the button is  
selected.  What I'd like is something like the round rect button in  
HUD style.  In other words, there's a border around it, it's  
obviously a button, and the text is always white.  I've seen  
examples of this before (the most recent that comes to mind is in  
AppShelf's details window, but I can't figure out how to do it.


Thanks,
- Walker Argendeli

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: HUD-Style buttons

2009-04-09 Thread Guillaume Laurent
On Thu, 9 Apr 2009 15:24:29 +0100, "jonat...@mugginsoft.com"
 wrote:
> Check out the BWToolkit.
> http://www.brandonwalkin.com/blog/2008/11/13/introducing-bwtoolkit/
> 

Naive beginner question : why aren't these UI elements/styles available in
IB by default ? Apple decision ?

--
Guillaume
http://telegraph-road.org

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Storing bundle loaded main class instances in NSArray

2009-04-09 Thread Alexander Spohr
Sorry I did not follow this thread as I thought it was a clear malloc/ 
free error.


 size_t fread(void * restrict ptr, size_t size, size_t nmemb,  
FILE * restrict stream);


Where is your ptr coming from?
If you comment out fread but rthe just crash somewhere else I’d bet  
your ptr or stream is garbage.

Please post the allocation/deallocation code around the fread.

atze



Am 09.04.2009 um 15:57 schrieb Daniel Luis dos Santos:


Summarizing the behaviour I see here

If I add an object (which is the principal class of  a bundle) to an  
NSMutableArray, later in the program I get the exception that the  
NSFileManager default manager object does not respond to a known  
message selector.
I further narrowed it down to a fread call (standard libc) that I do  
just before the exception is thrown. If I comment the fread the  
error appears at another point in the code when I am initializing a  
NSDictionary with dictionaryWithDictionary. That other error shows  
itself in the gdb log as a pointer  modified after being freed.


Since this error is a bit difficult to track and explain through  
emails, I appreciate all your help, and think I will try to debug  
some more (change the code to some other way of doing it).


Thanks anyway


On Apr 9, 2009, at 1:38 AM, Graham Cox wrote:



On 09/04/2009, at 2:13 AM, Daniel Luis dos Santos wrote:

I expect a file manager and it tells me that it does not respond  
to fileExistsAtPath



No you don't.

According to your original post, you are complaining that calling - 
addObject on _instances throws this error. So does _instances point  
to NSFileManager or an array, as the code implies?


You're confused, so the rest of us have no chance.

Regarding your comments about autorelease pools, sounds like you're  
relying on some assumed behaviour that is not stated anywhere in  
any documentation. Don't do that, you're just creating problems  
that don't need to be there. What about the autorelease pools  
created around the main event loop for example?


--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:
http://lists.apple.com/mailman/options/cocoa-dev/atze%40freeport.de

This email sent to a...@freeport.de


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSTextView HICocoaView performance

2009-04-09 Thread Ryan Joseph


On Apr 9, 2009, at 9:42 PM, Marcel Weiher wrote:



On Apr 9, 2009, at 1:06 , Ryan Joseph wrote:

I was really excited when Apple released HICocoaView so in  
particular I could use NSTextView in my Carbon apps. However, this  
thing has some pretty serious performance issue when resizing and  
when adding/removing lines (return or deleting while type).  
Resizing is painfully slow and choppy but the real issue is typing  
return which causes delays, very annoying. Has anyone noticed this  
(maybe it's just my code?) and knows of a fix? I'm thinking this  
could be partially related to NSScrollView as both the operations  
involve scrolling. Honestly I'm surprised this made it to release  
with this kind of performance blunder. Any suggestions are greatly  
appreciated. Thanks.


Have you sampled?  Sharked?

How large is your test?  What is it?  Have you tried the same text  
in TextEdit (which is also based on NSTextView + NSScrollView)?  How  
does it compare?


You give us almost no information to go on here...


I have used NSTextView in Cocoa windows without the HICocoaView and  
there is no problem so I assume this is a HICocoaView issue. Is the  
TextEdit example Carbon? Any Carbon example code that used NSTextView  
without this error would certainly be useful.


No, I have not done any performance tests because I don't have any  
control over the API's, NSScrollView/NSTextView and can not make  
optimizations. At around 1000+ lines if you insert/delete lines at  
the  top (i.e. low offsets) the problem is there. I think anyone who  
ever implemented a NSTextView in a HICocoaView would notice this one.


First step I wanted to know if this was a known issue before I spent  
time debugging. Thanks.





Cheers,

Marcel



Regards,
Josef

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: HUD-Style buttons

2009-04-09 Thread Kyle Sluder
On Thu, Apr 9, 2009 at 10:39 AM, Guillaume Laurent
 wrote:
> Naive beginner question : why aren't these UI elements/styles available in
> IB by default ? Apple decision ?

Who knows?  Ran out of time, maybe.

If you want official Apple HUD-style controls (I think we all do -- of
course, no offense meant towards Brandon), submit an enhancement
request at bugreport.apple.com.

--Kyle Sluder
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: HUD-Style buttons

2009-04-09 Thread Walker Argendeli

I also found this one:
http://code.google.com/p/bghudappkit/

Doe anyone have experience with either one or have a preference?

- Walker Argendeli

On Apr 9, 2009, at 10:23 AM, jonat...@mugginsoft.com wrote:


Checkout the BWToolkit
http://www.brandonwalkin.com/blog/2008/11/13/introducing-bwtoolkit/

On 9 Apr 2009, at 15:08, Walker Argendeli wrote:

I think I'm missing something obvious here.  I have a HUD window  
that I need buttons in.  The button style that looks closest to  
what I want is recessed, but that's not exactly what I'd like.   
See, that way, there's no border, and the text is black unless the  
button is selected.  What I'd like is something like the round rect  
button in HUD style.  In other words, there's a border around it,  
it's obviously a button, and the text is always white.  I've seen  
examples of this before (the most recent that comes to mind is in  
AppShelf's details window, but I can't figure out how to do it.


Thanks,
- Walker Argendeli

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/jonathan%40mugginsoft.com

This email sent to jonat...@mugginsoft.com


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com






___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Using authorization to enumerate restricted folders?

2009-04-09 Thread Kyle Sluder
On Thu, Apr 9, 2009 at 9:54 AM, Oleg Krupnov  wrote:
> Now I am puzzled what do I do next? How do I use this authorization
> reference, how do I pass it to the file manipulation functions?

You spawn a setuid root process to do the work.  See the
BetterAuthorizationSample for more:
http://developer.apple.com/SampleCode/BetterAuthorizationSample/index.html

--Kyle Sluder
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: HUD-Style buttons

2009-04-09 Thread Randall Meadows

On Apr 9, 2009, at 8:57 AM, Walker Argendeli wrote:


I also found this one:
http://code.google.com/p/bghudappkit/

Doe anyone have experience with either one or have a preference?


I've used BGHUDAppKit; I'm really satisfied with it, with the  
exception that it does not understand that scrollbars can be set to  
have double arrows at both ends, and does not render that correctly.

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: IKImageBrowserView crash

2009-04-09 Thread Bill Bumgarner

On Apr 8, 2009, at 12:36 PM, Ashley Clark wrote:

Thread 0 Crashed:
0   GLEngine0x1e4daf17  
glDeleteTextures_Exec + 23
1   libGL.dylib 0x941cc476 glDeleteTextures  
+ 38
2   com.apple.imageKit  0x93aa4684  
_deleteTextureForIKGLImageInfo + 105

3   com.apple.imageKit  0x93aa46da _removeOwners + 53
4   com.apple.CoreFoundation0x942bcb29  
CFDictionaryApplyFunction + 169
5   com.apple.imageKit  0x93aa528a - 
[IKGLSharedContextRegistry removeOwner:] + 141

6   com.apple.CoreFoundation0x9436ba3d __invoking___ + 29


Known bug.  It has been fixed.

If you (or anyone else) need more information about when the fix might  
be available, etc, please contact Apple's Developer Tech Support.


b.bum

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSTextView HICocoaView performance

2009-04-09 Thread Ryan Joseph


On Apr 9, 2009, at 10:22 PM, Marcel Weiher wrote:



On Apr 9, 2009, at 7:51 , Ryan Joseph wrote:

On Apr 9, 2009, at 9:42 PM, Marcel Weiher wrote:

On Apr 9, 2009, at 1:06 , Ryan Joseph wrote:

[NSTextView in  HICocoaView performance problems]


[requests for more information]


I have used NSTextView in Cocoa windows without the HICocoaView and  
there is no problem so I assume this is a HICocoaView issue.


Sounds like a reasonable assumption...which 30 seconds with Shark  
would allow you to confirm or refute:  launch Shark, launch your  
app,  do operation .


I will test first thing tomorrow.




Is the TextEdit example Carbon?


No.

No, I have not done any performance tests because I don't have any  
control over the API's, NSScrollView/NSTextView and can not make  
optimizations. At around 1000+ lines if you insert/delete lines at  
the  top (i.e. low offsets) the problem is there.


Hmm...that's odd and makes me wonder wether HICocooaView is the  
right suspect: the (layout) computations that are data-dependent  
shouldn't really have any interactions with the container that the  
text-view is in, and certainly shouldn't have a need for them.
Maybe there is something else going on?


Who knows what the interaction between the Cocoa view and Carbon view  
is doing. I'm sorry for not giving much information but I was hoping  
that first anyone could confirm NSTextView works with HICocoaView  
without these issues. My feeling is this is a bug with the bindings  
between the 2 systems.


I didn't mention the NSScrollView and NSTextView are created  
programatically but still I don't see how the API would work with the  
exception of some performance issues. I'll test with shark but any  
other test would be useful. Maybe asking the Carbon list would be a  
good idea also. Thanks again.





Marcel



Regards,
Josef

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Floating window on top of everything

2009-04-09 Thread Matt Neuburg
On or about 4/8/09 11:25 PM, thus spake "Andrew Farmer" :

> On 08 Apr 09, at 08:03, Matt Neuburg wrote:
>> On Tue, 7 Apr 2009 12:37:05 -0400, Walker Argendeli
>>  said:
>>> I am making a simple application that consists of a small HUD window
>>> that needs to float above another application.  How do I make it so
>>> that A. it floats above everything, and B. when I switch to another
>>> application, it remains on top.
>> 
>> Search the archives for example code showing how your app can be
>> notified
>> when an app switch occurs... m.
> 
> This isn't necessary, actually. Setting the window's level to
> NSFloatingWindowLevel or so, and setting it to not hide on deactivate,
> should be sufficient to make it stay above everything.

Really? He wants the HUD window to float above a certain *particular*
application ‹ different from his own ‹ and vanish when any other application
is frontmost. What, in your proposed architecture, would make it do that? m.

-- 
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Customizing Leopard, http://tinyurl.com/2t9629
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com



___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Path from NSFileHandle?

2009-04-09 Thread Michael Ash
On Thu, Apr 9, 2009 at 12:11 AM, Adam R. Maxwell  wrote:
> I recently noticed that you can use F_GETPATH with fcntl(2), but I've no
> idea what caveats are associated with it.  It might be easier than messing
> with inodes directly, anyway?

Good call. I had actually seen this before, but forgot what it was
called. When I couldn't find it again, I assumed I had just imagined
it

As for the caveats, at the very least it could fail if the object in
question doesn't have a path. I have no idea about other caveats, but
it wouldn't surprise me if it could give bad results for files that
have been moved, weird filesystems that don't support this, or other
things, but I just don't know.

Mike
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Path from NSFileHandle?

2009-04-09 Thread Michael Ash
On Thu, Apr 9, 2009 at 12:55 AM, Erg Consultant
 wrote:
> Unfortunately I can't do that as my class are wrappers around the ANSI file 
> I/O calls such as fopen, etc. - so I have to match their prototypes.

Can you explain this in more detail? fopen and friends do not deal
with NSFileHandle, so it seems to me that you're already quite distant
from matching their prototypes.

Mike
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Using authorization to enumerate restricted folders?

2009-04-09 Thread Oleg Krupnov
Thanks, Kyle. Isn't there really a way to do the work in the same
process? It seems quite tedious to transfer my existing
directory-scanning code into a separate process and set up the
communication between the processes...

On Thu, Apr 9, 2009 at 5:59 PM, Kyle Sluder  wrote:
> On Thu, Apr 9, 2009 at 9:54 AM, Oleg Krupnov  wrote:
>> Now I am puzzled what do I do next? How do I use this authorization
>> reference, how do I pass it to the file manipulation functions?
>
> You spawn a setuid root process to do the work.  See the
> BetterAuthorizationSample for more:
> http://developer.apple.com/SampleCode/BetterAuthorizationSample/index.html
>
> --Kyle Sluder
>
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Using authorization to enumerate restricted folders?

2009-04-09 Thread Michael Ash
On Thu, Apr 9, 2009 at 11:57 AM, Oleg Krupnov  wrote:
> Thanks, Kyle. Isn't there really a way to do the work in the same
> process? It seems quite tedious to transfer my existing
> directory-scanning code into a separate process and set up the
> communication between the processes...

There really is not. It's a fundamental part of how UNIX works:
privileges belong to an entire process, and cannot be elevated, only
diminished.

Mike
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Floating window on top of everything

2009-04-09 Thread Benjamin Dobson


On 9 Apr 2009, at 16:49:48, Matt Neuburg wrote:

On or about 4/8/09 11:25 PM, thus spake "Andrew Farmer" >:



On 08 Apr 09, at 08:03, Matt Neuburg wrote:

On Tue, 7 Apr 2009 12:37:05 -0400, Walker Argendeli
 said:
I am making a simple application that consists of a small HUD  
window

that needs to float above another application.  How do I make it so
that A. it floats above everything, and B. when I switch to another
application, it remains on top.


Search the archives for example code showing how your app can be
notified
when an app switch occurs... m.


This isn't necessary, actually. Setting the window's level to
NSFloatingWindowLevel or so, and setting it to not hide on  
deactivate,

should be sufficient to make it stay above everything.


Really? He wants the HUD window to float above a certain *particular*
application — different from his own — and vanish when any other  
application
is frontmost. What, in your proposed architecture, would make it do  
that? m.



That's not what he said:

How do I make it so that A. it floats above everything, and B. when  
I switch to another application, it remains on top.

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...

2009-04-09 Thread david paeme
This might be more interesting... looks like the thing some crash down  
in the bowels of LocaleGetValue?


As you probably gather, I have absolutely no idea what's going on in  
there... i've changed the code that launches this into the asymmetric  
request version for httpurlconnection (= threaded version), but is as  
basic as can be... just appends some data a webserver onto a  
nsmutabledata object...







Thread 2 Crashed:
0   com.apple.CoreFoundation  	0x90cd08c3  
__CFDictionaryFindBuckets1a + 147
1   com.apple.CoreFoundation  	0x90cd10c4  
CFDictionaryGetValueIfPresent + 100

2   com.apple.CoreFoundation0x90cd7bd3 CFLocaleGetValue + 275
3   com.apple.CoreFoundation  	0x90d15bd8  
_CFStrGetLanguageIdentifierForLocale + 88

4   com.apple.CoreFoundation0x90d256dd CFStringLowercase + 189
5   com.apple.CFNetwork   	0x90af38f7  
CookieUtils::copyStringAndLowerCase(__CFString const*) + 57
6   com.apple.CFNetwork   	0x90af3913  
CookieUtils::web_domainMatches(__CFString const*, __CFString const*) +  
19
7   com.apple.CFNetwork   	0x90b4d34c  
HTTPCookieStorage::copyCookiesForURL(__CFURL const*, unsigned char) +  
552
8   com.apple.CFNetwork   	0x90ad1734  
_CFHTTPCookieStorageCopyRequestHeaderFieldsForURL + 118
9   com.apple.CFNetwork   	0x90b33d2f  
HTTPProtocol::addCookies(__CFHTTPMessage*, _CFURLRequest const*) + 203
10  com.apple.CFNetwork   	0x90b383c0  
HTTPProtocol::createStream() + 864
11  com.apple.CFNetwork   	0x90b38b1d  
HTTPProtocol::createAndOpenStream() + 729
12  com.apple.CFNetwork   	0x90b4ad53  
URLConnectionLoader::loaderScheduleOriginLoad(_CFURLRequest const*) +  
377
13  com.apple.CFNetwork   	0x90b4a4ef  
URLConnectionLoader 
::LoaderConnectionEventQueue 
::processAllEventsAndConsumePayload(XConnectionEventInfoXLoaderEventParams>*, long) + 193
14  com.apple.CFNetwork   	0x90b4aa9e  
URLConnectionLoader::processEvents() + 92
15  com.apple.CFNetwork   	0x90af8b6b  
MultiplexerSource::perform() + 189
16  com.apple.CoreFoundation  	0x90cfe5f5 CFRunLoopRunSpecific +  
3141

17  com.apple.CoreFoundation0x90cfecd8 CFRunLoopRunInMode + 88
18  com.apple.Foundation  	0x95704d40 + 
[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] +  
320

19  com.apple.Foundation0x956a17ed -[NSThread main] + 45
20  com.apple.Foundation0x956a1394 __NSThread__main__ + 308
21  libSystem.B.dylib   0x94eb0095 _pthread_start + 321
22  libSystem.B.dylib   0x94eaff52 thread_start + 34

Thread 2 crashed with X86 Thread State (32-bit):
 eax: 0x0001  ebx: 0x90cd106a  ecx: 0x  edx: 0x
 edi: 0x  esi: 0x0002  ebp: 0xb0145fe8  esp: 0xb0145fd0
  ss: 0x001f  efl: 0x00010246  eip: 0x90cd08c3   cs: 0x0017
  ds: 0x001f   es: 0x001f   fs: 0x001f   gs: 0x0037
 cr2: 0x




On 08 Apr 2009, at 23:45, Greg Parker wrote:


On Apr 8, 2009, at 5:55 AM, David Paeme wrote:
I'm writing an application that accesses a http server via  
NSURLConnection's sendSynchronousRequest method, and it keeps  
crashing on me with an EXC_BAD_ADDRESS signal, without ever  
reaching the server.


This is the stack trace:

#0  0x94e7f1c6 in mach_msg_trap ()
#1  0x94e869bc in mach_msg ()
#2  0x90cfe0ae in CFRunLoopRunSpecific ()
#3  0x90cfecd8 in CFRunLoopRunInMode ()
#4  0x90ad5b1b in CFURLConnectionSendSynchronousRequest ()
	#5  0x9575526b in +[NSURLConnection  
sendSynchronousRequest:returningResponse:error:] ()
	#6  0x2c26 in -[EPBackEnd updateArticles] (self=0x12dc20,  
_cmd=0x77b76) at /Users/david/Code/Mac/EP/v0.2/EPBackEnd.m:287
	#7  0x219d in -[AppController refreshArticles:]  
(self=0x12dbb0, _cmd=0x77223, sender=0x123110) at /Users/david/Code/ 
Mac/EP/v0.2/AppController.m:52

#8  0x96b9753b in -[NSApplication sendAction:to:from:] ()
#9  0x96b97478 in -[NSControl sendAction:to:] ()
#10 0x96b972fe in -[NSCell _sendActionFrom:] ()
	#11 0x96b96957 in -[NSCell trackMouse:inRect:ofView:untilMouseUp:]  
()
	#12 0x96b961aa in -[NSButtonCell  
trackMouse:inRect:ofView:untilMouseUp:] ()

#13 0x96b95a64 in -[NSControl mouseDown:] ()
#14 0x96b941a3 in -[NSWindow sendEvent:] ()
#15 0x96b60d49 in -[NSApplication sendEvent:] ()
#16 0x96abe69f in -[NSApplication run] ()
#17 0x96a8b8a4 in NSApplicationMain ()
	#18 0x201c in main (argc=1, argv=0xb778) at /Users/david/ 
Code/Mac/EP/v0.2/main.m:13


That's not a crash. That's a run loop waiting patiently for  
something to happen. Look through the other threads for the one that  
actually crashed. (If you get a crash log, the crashed thread will  
be specially marked.)



--
Greg Parker gpar...@apple.com Runtime Wrangler


___

Cocoa-dev mailing list (Cocoa-de

Sqlite3

2009-04-09 Thread fawad shafi




Dear All,
i m working on sqlite3 database, problem is this that, when i insert data in 
database from xcode, n after this when i go to sqlite3 terminal. the data is 
not available there.

more strange is that after inserting data from app, when i try to access the 
records, i can access. But after restarting the app it fetches no record 

kindly somebody help me!!



Regards,
Fawad Shafi
iPhone Application DeveloperAddictive Mobility (ATC).


Rediscover Hotmail®: Now available on your iPhone or BlackBerry Check it out.
_
Rediscover Hotmail®: Now available on your iPhone or BlackBerry
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


FW: Cache

2009-04-09 Thread fawad shafi




Dear All,

i m working on UIWebView, i want that if any page displayed in UIWebView. it 
should store in cache, but with that page all its embeded images, css files, 
javascript files should be stored in cache.

When i called the page from cache, all the images,css files ,javascript files 
should be load from cache.

somebody help me!


Regards,
Fawad Shafi
iPhone Application Developer
Addictive Mobility (ATC).


Quick access to your favorite MSN content and Windows Live with Internet 
Explorer 8.  Download FREE now!
_
Quick access to your favorite MSN content and Windows Live with Internet 
Explorer 8. 
http://ie8.msn.com/microsoft/internet-explorer-8/en-us/ie8.aspx?ocid=B037MSN55C0701A___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSTextView HICocoaView performance

2009-04-09 Thread Marcel Weiher


On Apr 9, 2009, at 1:06 , Ryan Joseph wrote:

I was really excited when Apple released HICocoaView so in  
particular I could use NSTextView in my Carbon apps. However, this  
thing has some pretty serious performance issue when resizing and  
when adding/removing lines (return or deleting while type). Resizing  
is painfully slow and choppy but the real issue is typing return  
which causes delays, very annoying. Has anyone noticed this (maybe  
it's just my code?) and knows of a fix? I'm thinking this could be  
partially related to NSScrollView as both the operations involve  
scrolling. Honestly I'm surprised this made it to release with this  
kind of performance blunder. Any suggestions are greatly  
appreciated. Thanks.


Have you sampled?  Sharked?

How large is your test?  What is it?  Have you tried the same text in  
TextEdit (which is also based on NSTextView + NSScrollView)?  How does  
it compare?


You give us almost no information to go on here...

Cheers,

Marcel

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSTextView HICocoaView performance

2009-04-09 Thread Marcel Weiher


On Apr 9, 2009, at 7:51 , Ryan Joseph wrote:

On Apr 9, 2009, at 9:42 PM, Marcel Weiher wrote:

On Apr 9, 2009, at 1:06 , Ryan Joseph wrote:

[NSTextView in  HICocoaView performance problems]


[requests for more information]


I have used NSTextView in Cocoa windows without the HICocoaView and  
there is no problem so I assume this is a HICocoaView issue.


Sounds like a reasonable assumption...which 30 seconds with Shark  
would allow you to confirm or refute:  launch Shark, launch your app,  
 do operation .



Is the TextEdit example Carbon?


No.

No, I have not done any performance tests because I don't have any  
control over the API's, NSScrollView/NSTextView and can not make  
optimizations. At around 1000+ lines if you insert/delete lines at  
the  top (i.e. low offsets) the problem is there.


Hmm...that's odd and makes me wonder wether HICocooaView is the right  
suspect: the (layout) computations that are data-dependent shouldn't  
really have any interactions with the container that the text-view is  
in, and certainly shouldn't have a need for them.   Maybe there is  
something else going on?


Marcel

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Sqlite3

2009-04-09 Thread Drew Lawson
According to fawad shafi:

> i m working on sqlite3 database, problem is this that, when i
> insert data in database from xcode, n after this when i go to
> sqlite3 terminal. the data is not available there.
> 
> more strange is that after inserting data from app, when i try
> to access the records, i can access. But after restarting the app
> it fetches no record

I don't know the sqlite details, but this sounds like a SQL transaction
that isn't getting committed.  Does the sqlite API auto-commit changes?
Or do you have to do that explicitly?

-- 
Drew Lawson|  We were taking a vote when
   |  the ground came up and hit us.
   |  -- Cylon warrior
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: FW: Cache

2009-04-09 Thread I. Savant
On Thu, Apr 9, 2009 at 10:06 AM, fawad shafi  wrote:
> somebody help me!

  You're being obnoxious.

  If anybody has an answer for you, they'll answer your thread, but
re-posting and adding the demand 'somebody help me!' just adds
noise to the list, which only manages to annoy people enough to ignore
you entirely.

  The better way to approach this would be to reply to your own
response and *update it with the things you've tried in the interim*.
This not only reminds people that your thread remains unanswered but
provides more information that will help others answer your query if
they weren't able to before while showing that you're still working to
help yourself. Leave out the childish demands that 'SOMEBODY HELP you
!!!1!!!ONE!!!'.

--
I.S.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: find out where is a key equivalent assigned

2009-04-09 Thread Quincey Morris

On Apr 9, 2009, at 05:49, Georg Seifert wrote:

I have a old project with a big nib file and it seems that somewhere  
is a key equivalent defined for "ctrl+left cursor key". If I press  
"ctrl+left cursor key" nothing happend (option+left and everything  
else works fine).


I even tried subclassing NSApplication to track the event handling  
but with no success. I get the keypress event in NSApplication  
sendEvent: and in NSWindow sendEvent: but nothing more.


How do I find out where the event goes after this?


Ctrl-left arrow is one of the default hot keys used by Spaces. Do you  
have Spaces turned on?



___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: finder file size

2009-04-09 Thread Scott Ribe
> Neither of these two sentences makes any sense for me.

"Carbon" originally meant "the Classic Mac OS Toolbox APIs, as adapted to
work on OS X". But Apple has been evolving the meaning, by rebranding those
parts of the APIs that will live on in 64-bit and beyond to be "Core" APIs,
while "Carbon" becomes "that which used to supported for transition to OS X
but is no longer being developed." To a large extent now "Core" is
lower-level stuff, and "Carbon" is UI stuff, but of course "Carbon" also
contains dregs of ancient stuff that is lower-level but won't move on
because it's pointless--consider parameter block routines in the File
Manager for instance.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: HUD-Style buttons

2009-04-09 Thread Mike Glass
I use BWToolkit in practically every desktop app I work on, and it's  
fantastic. I can't recommend it enough.


On Apr 9, 2009, at 10:57 AM, Walker Argendeli wrote:


I also found this one:
http://code.google.com/p/bghudappkit/

Doe anyone have experience with either one or have a preference?



Mike Glass
Developer
Marware, Inc.

mi...@marware.com
http://www.projectx.com
http://www.marware.com

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: HUD-Style buttons

2009-04-09 Thread I. Savant
On Thu, Apr 9, 2009 at 1:50 PM, Mike Glass  wrote:
> I use BWToolkit in practically every desktop app I work on, and it's
> fantastic. I can't recommend it enough.

  I can vouch for BWToolkit as well. Though I haven't updated it in
awhile, the last version I played with did still have a few odd
behavioral bugs (particularly with the bottom bar controls) but it
might just have been user error. :-)

  It is a well-done addon.

--
I.S.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Change view on resize

2009-04-09 Thread Walker Argendeli
In Calculator.app, hitting the resize button lets you switch between  
three types of calculators.  What technique could I use to implement  
something like this in my app?  Note that I don't want the user to be  
able to resize the window by dragging the bottom-right corner.  I know  
I need to use view swapping, and I'm figuring I need to use the  
windowWillResize:toSize delegate method.

To recap:
How do I enable the resize button without enabling drag-resize?
- Do I use windowWillResize:toSize: to be notified?  How am I notified  
of the user clicking clicking the button?


Thanks,
- Walker Argendeli

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...

2009-04-09 Thread Greg Guerin

david paeme wrote:

This might be more interesting... looks like the thing some crash  
down in the bowels of LocaleGetValue?


Locale information is often taken from environment variables. Print  
the environment, compare it to when it doesn't crash, and check any  
differences.


Next, try running your code when logged in under a new user account.   
If it consistently works there, you may have a setting or a haxie of  
some kind in your original account that's breaking the code.  If it  
fails on the new user account, it could still be a haxie or similar,  
but installed at the system-wide level, typically in /Library/.


Finally, you first wrote "very similar to what's in aaron hillegass'  
book".  Have you tried the original code exactly as given in the  
book?  Did it also fail, or did it work?  If it also fails, that  
suggests something about your user account, environment, machine,  
configuration etc. If the original works, though, it suggests you've  
added a bug, so double-check every addition or deletion you made.


  -- GG

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Floating window on top of everything

2009-04-09 Thread Matt Neuburg
On Thu, 9 Apr 2009 17:31:52 +0100, Benjamin Dobson
 said:
>
>On 9 Apr 2009, at 16:49:48, Matt Neuburg wrote:
>
>> On or about 4/8/09 11:25 PM, thus spake "Andrew Farmer" > >:
>>
>>> On 08 Apr 09, at 08:03, Matt Neuburg wrote:
 On Tue, 7 Apr 2009 12:37:05 -0400, Walker Argendeli
  said:
> I am making a simple application that consists of a small HUD
> window
> that needs to float above another application.  How do I make it so
> that A. it floats above everything, and B. when I switch to another
> application, it remains on top.

 Search the archives for example code showing how your app can be
 notified
 when an app switch occurs... m.
>>>
>>> This isn't necessary, actually. Setting the window's level to
>>> NSFloatingWindowLevel or so, and setting it to not hide on
>>> deactivate,
>>> should be sufficient to make it stay above everything.
>>
>> Really? He wants the HUD window to float above a certain *particular*
>> application — different from his own — and vanish when any other
>> application
>> is frontmost. What, in your proposed architecture, would make it do
>> that? m.
>
>
>That's not what he said:
>
>> How do I make it so that A. it floats above everything, and B. when
>> I switch to another application, it remains on top.

Oh, I thought "floats above another application" meant "floats above another
*particular* application". After all, if that isn't what's meant, then why
didn't he start by asking for a HUD window that just floats above all
applications always?

You see, I've written some applications where I've got a floating window
that floats above *my* app if it is frontmost, but also floats a certain
particular other app if *it* is frontmost. (But vanishes if any *other*
application is frontmost.) Thus, my application's window and my
application's abilities are, as it were, injected into this one other
application, supplementing it. Now, of course the OP's original note was
confusingly written, but still, I thought I recognized in it a desire to do
the kind of thing I was doing... m.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


[MEET] LA CocoaHeads TONIGHT 4/9 7:30pm

2009-04-09 Thread Rob Ross

Greetings LA CocoaHeads.

Tonight Ken Bowlus will be demoing his iPhone app and discussing
how to set up an iPhone project, a high-level view of the iPhone API,
and a walk through of the source code for his app.


We meet at the offices of E! Entertainment at 7:30pm.

Our meeting location is

5750 Wilshire Blvd
Los Angeles, CA 90036.

Here's a google map of the location:

http://www.google.com/maps?f=q&hl=en&q=5750+Wilshire+Blvd,+Los+Angeles+CA+90036&ie=UTF8&z=15&om=1&iwloc=addr

Free street parking is available after 8pm - FEED THE METER UP TO 8PM
OR YOU MIGHT GET A TICKET!

I'd suggest trying Masselin Ave, which is one block East of Courtyard
Place.

We meet near the lobby of the West building at 5750 Wilshire Blvd, on
the West side of Courtyard Place. There are picknick tables in front
of the lobby and we'll gather there starting at 7:20pm. From there we
go inside and up to conference room 3A at around 7:45pm .

If you arrive late, please ask the building security personnel in the
lobby to direct you to the E! Security office, and they will be able
to contact the group in conference room 3A and send someone down to
meet you.


Rob Ross, Lead Software Engineer
E! Networks

---
"Beware of he who would deny you access to information, for in his
heart he dreams himself your master." -- Commissioner Pravin Lal
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


[MEET] BYU CocoaHeads TONIGHT 9 April 7:00pm

2009-04-09 Thread Dave DeLong

Hi everyone!

BYU CocoaHeads will be having their monthly meeting tonight at 7pm in  
room 184 of the Tanner Building on BYU campus in Provo, UT.  All are  
invited to attend.  Cory Kilger will be presenting on Localization,  
and Mark Suman will be demoing an iTunes-integrated app he's developed  
called "Visual Lyrics".


More information, including a map to the building, can be found on our  
website:  http://cocoaheads.byu.edu/meetings


Parking is free.  =)

See you there!

Dave DeLong
President, BYU CocoaHeads
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Request for good advise to programmatically locate iMovie 09

2009-04-09 Thread Huibert Aalbers

Hi everyone,

I am writing an app that requires to know if and where iMovie 09 is  
installed, since it needs to read a file located in its application  
bundle. I know I could ask the user to locate the app, but I would  
like to avoid it if possible, or use this strategy as a last resort.


Any suggestions?

Regards,

Huibert
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Request for good advise to programmatically locate iMovie 09

2009-04-09 Thread Nick Zitzmann


On Apr 9, 2009, at 2:22 PM, Huibert Aalbers wrote:

I am writing an app that requires to know if and where iMovie 09 is  
installed, since it needs to read a file located in its application  
bundle. I know I could ask the user to locate the app, but I would  
like to avoid it if possible, or use this strategy as a last resort.


Any suggestions?



Take a look at the functions in LaunchServices' LSInfo.h header.

Nick Zitzmann




___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Reversing OS X Menu Bar and Menus for True RTL Language Applications

2009-04-09 Thread Dalmazio Brisinda

Hello all,

I was wondering if anyone is aware of any work related to reversing  
the OS X menu bar and menus for true right-to-left language  
applications?


By true RTL I mean coupling language localization with actually  
flipping the entire menu bar so that the Apple Menu and menu items  
appears on the right side of the screen (instead of left), and the  
various shortcut icons appears on the left (instead of right).  
Additionally, menus would now open right to left extending leftwards  
across the screen (instead of rightwards).


Any thoughts or ideas would be helpful.

Best,
dalmazio

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Floating window on top of everything

2009-04-09 Thread Benjamin Dobson


On 9 Apr 2009, at 20:02:34, Matt Neuburg wrote:

Oh, I thought "floats above another application" meant "floats above  
another
*particular* application". After all, if that isn't what's meant,  
then why

didn't he start by asking for a HUD window that just floats above all
applications always?

You see, I've written some applications where I've got a floating  
window
that floats above *my* app if it is frontmost, but also floats a  
certain
particular other app if *it* is frontmost. (But vanishes if any  
*other*

application is frontmost.) Thus, my application's window and my
application's abilities are, as it were, injected into this one other
application, supplementing it. Now, of course the OP's original note  
was
confusingly written, but still, I thought I recognized in it a  
desire to do

the kind of thing I was doing... m.


I think we really need clarification from the OP here. :-)
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Send click to window

2009-04-09 Thread Nate Weaver
There are actually 2 NSEvent methods that aren't in my local docs here  
at work, but are in the headers and on developer.apple.com:


+ (NSEvent *)eventWithCGEvent:(CGEventRef)cgEvent;
- (CGEventRef)CGEvent;

10.5-only, though.

On Apr 9, 2009, at 6:24 AM, Dave Keck wrote:


Is it possible to send a simulated mouse click to a specific window,
overlapped by others?


CGEventPostToPSN() is what you want - but unfortunately it looks like
a little hackery will be involved to get it working. NSEvent has a
'windowNumber' property associated with it, but it doesn't look like
CGEvent has anything like that. (Although, I suspect it might, but
that value isn't part of the public API.)

I quickly tested CGEventPostToPSN() and was able to click Safari's
menu bar from my test app, but was not able to click inside Safari's.

I would try converting an NSEvent to a CGEvent (using NSEvent's
-eventRef method). Set the NSEvent's window number in its initializer,
and, with a little luck the windowNumber might find its way into the
CGEvent after the conversion. Again, this assumes CGEvent tracks
windowNumber in the first place, which there's no evidence that it
does.

Also, check out CGEventField. I searched it up and down for something
like kCGEventWindowNumber but, alas, it ain't there. So yeah, maybe
it's part of the private API...

At any rate, if you have trouble getting it working, which looks
likely, try asking about CGEventPostToPSN() on a quartz-dev or
something.

Good luck (and keep us posted!),

David

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...

2009-04-09 Thread david paeme

I guess I solved the problem:

I started thinking about why a locale would ever be needed - and all i  
could think of were strings and formatting. So I started fooling  
around with those... and the problem went away by using the  
userDefault differently: using a number (and %d) instead of a string  
(%@) the crashes went away


	NSString *urlString = [NSString stringWithFormat:@"%...@?act=upd&lu= 
%@",WS_URL,[[NSUserDefaults standardUserDefaults]  
objectForKey:@"lastDbUpdate"]];


became

UInt lastupdate = [userDefaults integerForKey:@"lastDBUpdate"];
	NSString *urlString = [NSString stringWithFormat:@"%...@?act=upd&lu= 
%d",WS_URL,lastUpdated];


with lastUpdated now coming out of userDefaults as an int, and no  
longer as a string.




i still have no idea why that solved the problem - my hunch would be  
the string parsing in the NSURLConnection - as both strings should be  
quite equal, no?








On 09 Apr 2009, at 20:56, Greg Guerin wrote:


david paeme wrote:

This might be more interesting... looks like the thing some crash  
down in the bowels of LocaleGetValue?


Locale information is often taken from environment variables. Print  
the environment, compare it to when it doesn't crash, and check any  
differences.


Next, try running your code when logged in under a new user  
account.  If it consistently works there, you may have a setting or  
a haxie of some kind in your original account that's breaking the  
code.  If it fails on the new user account, it could still be a  
haxie or similar, but installed at the system-wide level, typically  
in /Library/.


Finally, you first wrote "very similar to what's in aaron hillegass'  
book".  Have you tried the original code exactly as given in the  
book?  Did it also fail, or did it work?  If it also fails, that  
suggests something about your user account, environment, machine,  
configuration etc. If the original works, though, it suggests you've  
added a bug, so double-check every addition or deletion you made.


 -- GG

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/dvdpm.cocoa%40gmail.com

This email sent to dvdpm.co...@gmail.com


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Change view on resize

2009-04-09 Thread Dave Keck
> How do I enable the resize button without enabling drag-resize?
> - Do I use windowWillResize:toSize: to be notified?  How am I notified of
> the user clicking clicking the button?

To satisfy both these requirements, I would first disable window
resizing for your window in IB. Then, somewhere in your app's
initialization code, do a little something like this:

NSButton *zoomButton = [window standardWindowButton: NSWindowZoomButton];
[zoomButton setEnabled: YES];
[zoomButton setTarget: self];
[zoomButton setAction: @selector(doFancyThings:)];

Then, when your window's zoom button is clicked, doFancyThings: will
be called. Viola!

David
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Send click to window

2009-04-09 Thread Dave Keck
> There are actually 2 NSEvent methods that aren't in my local docs here at
> work, but are in the headers and on developer.apple.com:
>
> + (NSEvent *)eventWithCGEvent:(CGEventRef)cgEvent;
> - (CGEventRef)CGEvent;

Woops :) That could be why I wasn't able to send click events to other
apps' windows. For some reason I read NSEvent's -eventRef as returning
a CGEvent, rather than an 'EventRef'.

I'll modify my test app and see if I can't get click events working.
I'll keep y'all posted.

David
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Setting Min, MAx and range of characters for NSTextField

2009-04-09 Thread Preston Jackson
I have the same issue. I'm binding my NSTextField value to my model  
and using key-value validation to ensure the value is the right  
length. If the user enters a value that it too short, the coerced  
value will make it into my model, but the NSTextField keeps the pre- 
validate value.


Anyone have any ideas on this?

Preston Jackson
http://sidelightblog.blogspot.com

On Apr 8, 2009, at 8:36 AM, development2 wrote:

I hope someone can help me. I need to set a Min and Max length for  
an NSTextField. I also need to only allow certain characters that  
the user can enter. How can this be accomplished? Do I have to use  
an NSFormatter? If so are there any examples that someone can point  
me to?


Thanks in advance.
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/preston.a.jackson%40gmail.com

This email sent to preston.a.jack...@gmail.com


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Request for good advise to programmatically locate iMovie 09

2009-04-09 Thread Sean McBride
On 4/9/09 2:25 PM, Nick Zitzmann said:

>> I am writing an app that requires to know if and where iMovie 09 is
>> installed, since it needs to read a file located in its application
>> bundle. I know I could ask the user to locate the app, but I would
>> like to avoid it if possible, or use this strategy as a last resort.
>>
>> Any suggestions?
>
>
>Take a look at the functions in LaunchServices' LSInfo.h header.

Or NSWorkspace's absolutePathForAppBundleWithIdentifier:.

--

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


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


static method to create CABasicAnimation: does this create a memory leak?

2009-04-09 Thread Miles
I have created a static method creating and returning an animation that I
use in various places in my application. I think this may be causing a leak.
If I autorelease theAnimation in the return statement I get a crash because
I the animation must be being release before it's complete.
Is this indeed causing a leak? If so, is there another way to do this
without a leak?


+(CABasicAnimation *)fadeIn {

CABasicAnimation *theAnimation;
theAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.fromValue = [NSNumber numberWithFloat:0];
theAnimation.toValue = [NSNumber numberWithFloat:1.0];
theAnimation.duration = 1.0;
return theAnimation;
}

then I us it like this:


CABasicAnimation *anim = [AnimationCreatorUtil fadeIn];
anim.delegate = self;
[[scoreHolderView layer] addAnimation:anim forKey:@"fadeIn"];

Thanks!
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Send click to window

2009-04-09 Thread Dave Keck
I finally got clicks forwarding to another process. I made an example
project, available here: http://www.docdave.com/clicktest.zip

NOTE: You have to setup the project first - in the Globals.h file,
define 'PID' to the process that you want clicks to be forwarded to,
and 'WID' to the window ID of the window in that process. Both these
values can be retrieved from Quartz Debug (Tools > Show Window List).
I tested the event forwarding with Safari.

When you run the project, make the 'event-forwarding' window the same
size as the event-receiver window. Then slightly offset the
event-forwarding window from the receiving window. Click away inside
the forwarding window, and notice how mouse clicks, mouse drags, and
right-mouse clicks are all forwarded to the other process.

David
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: static method to create CABasicAnimation: does this create a memory leak?

2009-04-09 Thread Randall Meadows

On Apr 9, 2009, at 6:00 PM, Miles wrote:

I have created a static method creating and returning an animation  
that I
use in various places in my application. I think this may be causing  
a leak.
If I autorelease theAnimation in the return statement I get a crash  
because

I the animation must be being release before it's complete.


Right, because "theAnimation" is *already* autoreleased.  The method  
"animationWithKeyPath" does not contain "new", "alloc", or "copy",  
therefore you do not own the object, and therefore you are not  
responsible for (auto)releasing it.



Is this indeed causing a leak?


No.

Might I suggest you review .


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...

2009-04-09 Thread Greg Guerin

david paeme wrote:


instead of a string (%@) the



%@ is the code for the -description of an object.  Strictly speaking,  
that isn't merely a string, but the result of sending a message.




UInt lastupdate = [userDefaults integerForKey:@"lastDBUpdate"];
NSString *urlString = [NSString stringWithFormat:@"%...@?act=upd&lu= % 
d",WS_URL,lastUpdated];


Either you have typos, or that isn't doing what you think it's  
doing.  The UInt is named "lastupdate", but the arg to  
stringWithFormat: is named "lastUpdated".  Note the difference in  
case for 'U' and the presence of 'd' for the latter.



i still have no idea why that solved the problem - my hunch would  
be the string parsing in the NSURLConnection - as both strings  
should be quite equal, no?


You could NSLog the text, generated both ways, and probably confirm  
or refute the hunch. Evidence is better than hunches, especially when  
it's easy to get.


  -- GG

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Sqlite3

2009-04-09 Thread Hank Heijink (Mailinglists)


On Apr 8, 2009, at 8:24 AM, fawad shafi wrote:

i m working on sqlite3 database, problem is this that, when i insert  
data in database from simulator, n after this when i go to sqlite3  
terminal. the data is not available there.


more strange is that after inserting data from simulator, when i try  
to access the records, i can access. But after restarting the  
simulator it fetches no record


I believe that every time you restart the simulator, the path to your  
Documents folder changes (note the hexadecimal part of the path to  
Documents). Are you sure you're looking at the current database file  
and not the previous one? I'd log the path to the database when you  
start your app and compare that to the path you think your database is  
at.


Good luck,
Hank

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: OO idiom avoiding switch and if

2009-04-09 Thread Sherm Pendley
On Thu, Apr 9, 2009 at 9:45 PM, Jeffrey Oleander  wrote:

>
> There's a programming idiom to avoid using complex if statements and
> switch/case statements, and instead to just send a message to a different
> class of object.
>
> I'm doing some parsing of an old text data format which
> has a hierarchy with a record and then sub-records and
> sub-sub records, 1 per "line".  Each is structured as
> a type, nesting level number and then various kinds of
> values depending thereon.  What I'm agonizing over is
> how best to handle invoking the processing for each
> sub-record type in Objective-C.  This would seem to
> require having a bunch of classes with names like
> JGRecordTypeParser and then I might do something like:
> NSString * valueParserClassPrefix = @"JG";
> NSString * valueParserClass = [[valueParserClassPrefix
> stringByAppendingString:recordSubType] stringByAppendingString:@"Parser"];
> [[NSClassFromString(valueParserClass) alloc] initWithTokens:tokens
>  recordType:recordType level:aLevel];
> or some such.
>

In general, a polymorphic approach as in your first example is usually
recommended over a switch. It's considered "good OOP," and I don't think
it's messy at all. In fact, I think that constructing the class name like
that is a very elegant use of the dynamic nature of the Objective-C run
time. It also follows the Cocoa convention of establishing and using naming
patterns.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


OO idiom avoiding switch and if

2009-04-09 Thread Jeffrey Oleander

There's a programming idiom to avoid using complex if statements and 
switch/case statements, and instead to just send a message to a different class 
of object.

I'm doing some parsing of an old text data format which
has a hierarchy with a record and then sub-records and
sub-sub records, 1 per "line".  Each is structured as 
a type, nesting level number and then various kinds of 
values depending thereon.  What I'm agonizing over is 
how best to handle invoking the processing for each 
sub-record type in Objective-C.  This would seem to 
require having a bunch of classes with names like 
JGRecordTypeParser and then I might do something like:
NSString * valueParserClassPrefix = @"JG";
NSString * valueParserClass = [[valueParserClassPrefix 
stringByAppendingString:recordSubType] stringByAppendingString:@"Parser"];
[[NSClassFromString(valueParserClass) alloc] initWithTokens:tokens  
recordType:recordType level:aLevel];
or some such.

Or, I could just do it all in my primary parser class
[self parseValueOfType:recordType subRecordType:subType level:aLevel];
and then have the rat's nest inside there:
switch (recodType)
{
  case thisType:
   //...
   break;
  case thatType:
   //...
   break;
  default:
  //...
}

Advice on what's least messy overall or pointers
to sources of info would be appreciated.


  
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Request for good advise to programmatically locate iMovie 09

2009-04-09 Thread Huibert Aalbers

Thank you very much to both of you. Works like a charm.

Regards,

Huibert


On 09/04/2009, at 06:16 p.m., Sean McBride wrote:


On 4/9/09 2:25 PM, Nick Zitzmann said:


I am writing an app that requires to know if and where iMovie 09 is
installed, since it needs to read a file located in its application
bundle. I know I could ask the user to locate the app, but I would
like to avoid it if possible, or use this strategy as a last resort.

Any suggestions?



Take a look at the functions in LaunchServices' LSInfo.h header.


Or NSWorkspace's absolutePathForAppBundleWithIdentifier:.

--

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




___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Change view on resize

2009-04-09 Thread Kyle Sluder
On Thu, Apr 9, 2009 at 6:52 PM, Dave Keck  wrote:
> To satisfy both these requirements, I would first disable window
> resizing for your window in IB. Then, somewhere in your app's
> initialization code, do a little something like this:

Calculator.app apparently does the opposite, from looking at its nib.
It starts with resize enabled and then somehow eliminates the
drag-resizing functionality.

--Kyle Sluder
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: OO idiom avoiding switch and if

2009-04-09 Thread Michael Ash
On Thu, Apr 9, 2009 at 11:20 PM, Sherm Pendley  wrote:
> On Thu, Apr 9, 2009 at 9:45 PM, Jeffrey Oleander  wrote:
>
>>
>> There's a programming idiom to avoid using complex if statements and
>> switch/case statements, and instead to just send a message to a different
>> class of object.
>>
>> I'm doing some parsing of an old text data format which
>> has a hierarchy with a record and then sub-records and
>> sub-sub records, 1 per "line".  Each is structured as
>> a type, nesting level number and then various kinds of
>> values depending thereon.  What I'm agonizing over is
>> how best to handle invoking the processing for each
>> sub-record type in Objective-C.  This would seem to
>> require having a bunch of classes with names like
>> JGRecordTypeParser and then I might do something like:
>> NSString * valueParserClassPrefix = @"JG";
>> NSString * valueParserClass = [[valueParserClassPrefix
>> stringByAppendingString:recordSubType] stringByAppendingString:@"Parser"];
>> [[NSClassFromString(valueParserClass) alloc] initWithTokens:tokens
>>  recordType:recordType level:aLevel];
>> or some such.
>>
>
> In general, a polymorphic approach as in your first example is usually
> recommended over a switch. It's considered "good OOP," and I don't think
> it's messy at all. In fact, I think that constructing the class name like
> that is a very elegant use of the dynamic nature of the Objective-C run
> time. It also follows the Cocoa convention of establishing and using naming
> patterns.

A nice intermediate stage between writing a big switch statement and
having a bunch of different classes is to use your text to find
*methods* rather than classes. For example:

NSString *methodName = [NSString
stringWithFormat:@"proce...@subtypewithtokens:", [[recordSubType
lowercaseString] capitalizedString]];
[self performSelector:NSSelectorFromString(methodName) withObject:tokens];

Then you'd write methods named processFooSubTypeWithTokens:,
processBarSubTypeWithTokens:, etc. Adding error checking to see if the
method exists before you try to call it is also fairly
straightforward. If the number of different types isn't too large,
this can keep things better organized and more convenient by keeping
everything in the same class.

Mike
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Setting Min, MAx and range of characters for NSTextField

2009-04-09 Thread Kyle Sluder
On Thu, Apr 9, 2009 at 7:02 PM, Preston Jackson
 wrote:
> Anyone have any ideas on this?

First, you typically don't bind views directly to the model.  You
instead bind them through a controller.

I did a quick test, however, in which I did bind an NSTextField
straight to my model.  I created a simple NSObject subclass with an
NSString property called "uppercaseString".  I also implemented
-validateUppercaseString:error: to always convert the string to
uppercase.  I then bound an NSTextField to this property, and turned
on "Validates Immediately."  It works like a charm.

Here is my implementation of -validateUppercaseString:error:, for reference.

- (BOOL)validateUppercaseString:(id *)newValue error:(NSError **)error
{
   if(*newValue == nil)
  return YES;

   *newValue = [*newValue uppercaseString];
   return YES;
}

How does your implementation differ?  Are you perhaps mutating the
*newValue instead of returning a new object, as the documentation says
you must?  
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/KeyValueCoding/Concepts/Validation.html#//apple_ref/doc/uid/20002173-168285

--Kyle Sluder
___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Undocumented flags in LSCopyItemInfoForRef

2009-04-09 Thread Gerriet M. Denkmann


LSItemInfoFlags, returned by LSCopyItemInfoForRef() when the queried  
item is an application, contains several undocumented flags (i.e.  
flags which are NOT documented in LSInfo.h nor in the Launch Services  
Reference).


E.g. iTunes.app has (among well documented flags) also: 0x6804000.

Where can I find the meaning of these flags?

10.5.6; Documentation updated on 19.3.2009.

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: OO idiom avoiding switch and if

2009-04-09 Thread Greg Guerin

Jeffrey Oleander wrote:


Advice on what's least messy overall or pointers
to sources of info would be appreciated.



http://en.wikipedia.org/wiki/Finite_state_machine


http://en.wikipedia.org/wiki/Reflection_(computer_science)

"Convert a string matching the symbolic name of a class or function  
into a reference to or invocation of that class or function."


http://en.wikipedia.org/wiki/Type_introspection


On the whole, "least messy" depends on exactly what you're trying to  
parse.


  -- GG

___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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