Archive for July, 2009

Ye Olde AEIdleProcPtr

Posted in Apple on July 31st, 2009 by Saba – Be the first to comment

Hi,

In days of yore, when sending an AppleEvent with AESend, you could use an AE idleProc to allow for cancelling the event if you had reason to bail. The parameters also pass you an EventRecord and you are expected to handle window update events.

Now, I have a Cocoa app that has to send an AppleEvent with no timeout specified. It should only bail if the event fails or the user cancels. Apart from using an AE idle proc, I can’t see how to make this happen.

All of my relevant AE occurs on the same subthread. That thread is blocked waiting for AESend to return with a reply.

I assume the idle proc is called on the main thread. I have no idea what to do with the EventRecord, if I should do anything that concerns Cocoa.

In my Cocoa app, can I use this idle proc and just ignore the EventRecord? I don’t see a Cocoa API that would allow me to pass the event to it. Is this even relevant without Carbon windows?

Maybe there is a better way to go at this. Can someone de-fuzz things here from me?

Eric

incorrect checksum for freed object

Posted in Apple on July 31st, 2009 by Saba – 8 Comments

(i’m not sure if this is the right list for this question or not, as i am developing a cocoa application using IOKit. if this isn’t the right list, could someone please tell me the right list. thanx.)

i’m just starting on developing a core data document base app that talks to a usb device. sometimes, but not always, i’m getting crashes when i’m either releasing my IOUSBDeviceInterface300 or my IOUSBInterfaceInterface300. the error i get on the console is:

malloc: *** error for object 0×102662970: incorrect checksum for freed object – object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug

and i have set that breakpoint. the stack trace at the time is:

#0 0×83d7aa51 in malloc_error_break #1 0×83d75ad0 in szone_error #2 0×83cb5571 in tiny_free_list_add_ptr #3 0×83cb28cf in szone_free #4 0×025876ba in IOUSBDeviceClass::~IOUSBDeviceClass #5 0×02586f0d in IOUSBIUnknown::release #6 0×00001f1a in -[BaseUSBInterface releaseResources] at BaseUSBInterface.mm:154

in response to: err = (*(self.interface))->Release( self.interface); or err = (*(self.device))->Release( self.device);

where interface and device are declared as follows: @property ( assign, nonatomic) IOUSBDeviceInterface300** device; @property ( assign, nonatomic) IOUSBInterfaceInterface300** interface; and synthesized. i am running in 64 bit mode and have NOT declared my own iVars for these.

these errors don’t happen every time and i’ve yet to be able to determine a pattern that causes them. i realize that this is some sort of memory corruption problem, but i’m at a loss as to how to find it. i do have NSZombieEnabled set to YES and CFZombieLevel set to 3.

can anyone one offer suggestions as to how to find this problem.

thanx, ken

August CocoaHeads Mac Developer Meetings

Posted in Apple on July 31st, 2009 by Saba – Be the first to comment

Greetings,

CocoaHeads is an international Mac programmer’s group. Meetings are free and open to the public. We specialize in Cocoa, but everything Mac programming related is welcome.

Upcoming meetings: Australia Sydney- Thursday, August 6, 2009 18:30.

Canada Ottawa/Gatineau- Thursday, August 13, 2009 19:00. Victoria- Thursday, August 6, 2009 19:00.

Denmark Copenhagen- Tuesday, August 11, 2009 19:00.

Germany Hamburg- Wednesday, August 5, 2009 19:00. Munich- Thursday, August 13, 2009 20:00.

Sweden Malmö- Tuesday, August 11, 2009. Stockholm- Monday, August 3, 2009 19:00.

Switzerland Zürich- Thursday, August 13, 2009 19:00.

United States Ann Arbor- Thursday, August 13, 2009 19:00. Boulder- Tuesday, August 11, 2009 19:00. Colorado Springs- Thursday, August 13, 2009 19:00. Columbia- Tuesday, August 11, 2009 19:00. Columbus- Tuesday, August 11, 2009 19:00. Dallas- Thursday, August 13, 2009 19:00. Denver- Tuesday, August 11, 2009 19:00. Des Moines- Thursday, August 13, 2009 18:00. Detroit- Thursday, August 14, 2008 20:00. Fayetteville- Thursday, August 13, 2009 18:00. Indianapolis- Tuesday, August 11, 2009 19:00. Lake Forest- Wednesday, August 12, 2009 19:00. Minneapolis- Thursday, August 13, 2009 18:00. Nashville- Thursday, August 13, 2009 19:00. New York- Thursday, August 13, 2009 18:00. Philadelphia- Thursday, August 13, 2009 19:00. Pittsburgh- Thursday, August 13, 2009 19:30. St. Louis- Saturday, August 29, 2009 14:00. Upper Connecticut River Valley- Thursday, August 13, 2009 19:00.

United Kingdom Swindon- Monday, August 3, 2009 20:00.

Some chapters may have yet to post their meeting for next month. Meeting times may change. Locations and more information here: http://cocoaheads.org

Also be sure to check for an NSCoder Night in your area: http://nscodernight.com/

Steve Silicon Valley CocoaHeads

What is going on with CALayer

Posted in Apple on July 31st, 2009 by Saba – 3 Comments

HI: This is very strange problem. This code works fine with OS 2.2 but does not work with OS 3.x Can someone point me why it failed? Your help will be very much appreciated. Best regards -Agha

But why?

// NumberLayer.h #import #import

@interface NumberLayer: CALayer { } @end

and now NumberLayer.m file

#import “NumberLayer.h”

@implementation NumberLayer @end

“.objc_class_name_CALayer”, referenced from: “.objc_class_name_NumberLayer in NumberLayer.o symble(s) not found collect2: Id returned 1 exit status

Build failed (1 error)

Google and Bing don’t save preferences

Posted in Firefox on July 31st, 2009 by Saba – 11 Comments

I save the number of results returned in either Bing or Google. I can see the setting in their cookies: NR=100 for Google, NRSLT=50 for Bing. I can go in and out of these search engines and this preference setting remains.

But if I leave Firefox and restart it, I look at the Cookies and their are all gone. When I start the search engine(s), they initialize cookie(s). But the results settings are not there. They appear once I set preferences during that iteration of Firefox; they remain while I am in Firefox.

I have it set to “keep ’til they expire” and have no exceptions set.

IE works correctly.

This problem begin with FF 3.5.

I am assuming it is not a corrupted cookie problem since the Show Cookies is empty when I first open Firefox.

Thanks for any help.

John

List all the app-defined keywords?

Posted in Apple on July 31st, 2009 by Saba – 2 Comments

Folks,

I have searched the archives and done a bunch of googling, but I cannot find an answer to this.

I want to get a list of all the application-defined keywords, so that I can avoid writing scripts that inadvertently use these. I want to do something like this:

tell application “Some App” set keylist to keywords of application return keylist end tell

Is there a way to do this? How?

Thanks – Dave.S

Fwd: Targeting Applications

Posted in Apple on July 31st, 2009 by Saba – Be the first to comment

To make this post more accurate I’m sending this update. I had to put in “using terms from” in order to get it to compile.

on clicked theObject set App10 to “Adobe Illustrator 10″ set AppCS3 to “Adobe Illustrator”

using terms from application “Adobe Illustrator” tell application AppCS3 activate make new document end tell end using terms from

using terms from application “Adobe Illustrator 10″ tell application App10 activate make new document end tell end using terms from end clicked

Begin forwarded message:

> From: Steven Valenti > Date: July 31, 2009 11:21:06 AM EDT > To: HAMSoft Admin > Cc: applescript-studio@lists.apple.com > Subject: Re: Targeting Applications > > Now that I remember, I have simply put the name in a variable > before to do something similar. > > on clicked theObject > set AppVersion10 to “Adobe Illustrator 10″ > set AppVersionCS3 to “Adobe Illustrator” > > tell application AppVersion10 > activate > make new document > end tell > > tell application AppVersionCS3 > activate > make new document > end tell > end clicked > > This seems to work…. Thanks for the input! > > Steven > > > > > > > On Jul 31, 2009, at 11:08 AM, HAMSoft Admin wrote: > >> There’s 2 ways I can think of to target a specific application: >> 1) target the application by its path… >> set appPath to (path to applications folder as text) & “Address >> Book.app” >> tell application appPath >> activate >> end tell >> >> 2) in 10.5 or later you can use an application’s “id”. For example >> with the Address Book application… >> tell application id “com.apple.AddressBook” >> activate >> end tell >> >> You can get the “id” of an application like this… maybe the 2 >> versions have a different id >> set anApplication to choose file >> tell application “Finder” >> return (id of anApplication) >> end tell >> >> Sincerely, >> Hank McShane >> HAMSoft Engineering >> http://www.hamsoftengineering.com >> >> >> >> >> >> On Jul 31, 2009, at 10:52 AM, Steven Valenti wrote: >> >>> I need to use two different versions of Illustrator to create >>> some properly converted files for manufacturing. Just a small >>> part in version 10 needs to export the file as a .cgm. My problem >>> is that when I run this script within ASS, it will only target >>> the app version that was started on the computer first. >>> >>> on clicked theObject >>> tell application “Adobe Illustrator 10″ >>> activate >>> make new document >>> end tell >>> >>> tell application “Adobe Illustrator” >>> activate >>> make new document >>> end tell >>> end clicked >>> >>> Same script run from Script Debugger can tell the difference >>> between versions. Any reason why ASS can’t? >>> >>> >>> >>> >>> >>> Steven Valenti | Zippo Manufacturing Company | Creative >>> Services / Manufacturing Liaison, Macintosh Support Specialist, >>> Creative Services Department | 33 Barbour Street, Bradford, >>> Pennsylvania 16701 | p: 814-368-2741 | f: 814-363-2575 | e: >>> svalenti@zippo.com >>> >>> _______________________________________________ >>> Do not post admin requests to the list. They will be ignored. >>> AppleScript-Studio mailing list (AppleScript- >>> Studio@lists.apple.com) >>> http://lists.apple.com/mailman/options/applescript-studio/admin% >>> 40hamsoftengineering.com >>> >>> This email sent to admin@hamsoftengineering.com >> >

Runts & Gaints

Posted in Cisco on July 31st, 2009 by Saba – Be the first to comment

Due to what reasons I may recive runts & gaints on my Interface SH RUNN INT GI 11/6Building configuration… Current configuration : 220 bytes!interface GigabitEthernet11/6 switchport switchport access vlan 502 switchport mode access no ip address speed 100 duplex full spanning-tree portfastend XXXXXXXX#SH RUNN INT GI 11/9Building configuration… Current configuration : 218 bytes!interface GigabitEthernet11/9 switchport switchport access vlan 502 switchport mode access no ip address speed 100 duplex full spanning-tree portfastend

SH INT GI 11/6GigabitEthernet11/6 is up, line protocol is up (connected) Hardware is C6k 1000Mb 802.3, address is 001b.d5fe.29dd (bia 001b.d5fe.29dd) Description: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX MTU 1500 bytes, BW 100000 Kbit, DLY 10 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Full-duplex, 100Mb/s input flow-control is off, output flow-control is on Clock mode is auto ARP type: ARPA, ARP Timeout 04:00:00 Last input never, output 00:00:56, output hang never Last clearing of “show interface” counters 1w2d Input queue: 0/2000/161044/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 3000 bits/sec, 6 packets/sec 28590011 packets input, 3155794998 bytes, 0 no buffer Received 3238 broadcasts (9 multicasts) 8779 runts, 141 giants, 0 throttles 161044 input errors, 83386 CRC, 0 frame, 0 overrun, 0 ignored 0 watchdog, 0 multicast, 0 pause input 0 input packets with dribble condition detected 53066376 packets output, 57544944850 bytes, 0 underruns 0 output errors, 0 collisions, 0 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier, 0 PAUSE output 0 output buffer failures, 0 output buffers swapped out xxxxxxxxxx#SH INT GI 11/9GigabitEthernet11/9 is up, line protocol is up (connected) Hardware is C6k 1000Mb 802.3, address is 001b.d5fe.29e0 (bia 001b.d5fe.29e0) Description: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX MTU 1500 bytes, BW 100000 Kbit, DLY 10 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Full-duplex, 100Mb/s input flow-control is off, output flow-control is on Clock mode is auto ARP type: ARPA, ARP Timeout 04:00:00 Last input never, output 00:00:03, output hang never Last clearing of “show interface” counters 40w0d Input queue: 0/2000/31379086/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 70000 bits/sec, 34 packets/sec 5 minute output rate 25000 bits/sec, 9 packets/sec 1246875972 packets input, 678093317020 bytes, 0 no buffer Received 11404 broadcasts (0 multicasts) 336645 runts, 8315 giants, 0 throttles 31379086 input errors, 30144143 CRC, 0 frame, 0 overrun, 0 ignored 0 watchdog, 0 multicast, 0 pause input 0 input packets with dribble condition detected 828815484 packets output, 126903728484 bytes, 0 underruns 0 output errors, 0 collisions, 0 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier, 0 PAUSE output 0 output buffer failures, 0 output buffers swapped out

NSTabView Tutorial

Posted in Apple on July 31st, 2009 by Saba – 2 Comments

I’m looking for a simple NSTabView tutorial. I’ve found references to the MultipleNIBTabView tutorial but I can’t find it in the current Xcode Examples area or at the Developer site. Anyone know where it is located, or whether there is another tutorial around?

Thanks,

Tom Wetmore

How to change focus ring color?

Posted in Apple on July 31st, 2009 by Saba – 9 Comments

Hi, All,

I can’t find how I could change the focus ring color, for example, of NSPathControl. The IB only lets me disable it. Is the color defined by the color scheme hardly?

Thanks.