Re: persisting user credentials -- how?

2009-03-10 Thread Mike Abdullah
There's also NSURLCredentialStorage which is more specialised than the keychain services, but for a web service may be ideal. On 9 Mar 2009, at 21:32, Stefan Wolfrum wrote: Hi, I have a little app that needs a username & password to log into some web service. These user credentials should

Re: [ANN] InspectorKit (framework/IB-plugin)

2009-03-10 Thread Mike Abdullah
Hi Steven, this looks very interesting thanks. Could I ask you to describe how it differs from OmniInspector, other than having an IB Plugin? Mike. On 10 Mar 2009, at 05:05, Steven Degutis wrote: Hi all! I've just released a piece of open-source software (BSD license) as both a framework

Re: Is UITableView more memory efficient than UIScrollView?

2009-03-09 Thread Mike Abdullah
Well it rather depends what you ask UIScrollView to do for you… The most important thing is to recycle or dispose of views that are no longer visible to the user. Care to explain more what your code is actually doing? Mike. On 9 Mar 2009, at 22:27, James Cicenia wrote: I am trying to get

Re: Method Sequence on Application Loads

2009-03-09 Thread Mike Abdullah
On 9 Mar 2009, at 05:49, Kenneth Ramey wrote: I am looking for information on the sequence of method invocation as an application loads. For instance, Apple's documentation says that awakeFrom Nib is called after the user interface loads but before any events have been handled. I want to

Re: Newbie: Learning path for my GTD app...

2009-03-04 Thread Mike Abdullah
On 4 Mar 2009, at 05:40, Biagio wrote: Hello. My first post. I'm learning to program using Xcode 3.1.2 in OS X Leopard. My current plan of attack is working through these books: Learn C on the Mac C All in One Desktop Reference for Dummies Learn Objective-C On the Mac Cocoa Programming for M

Re: Terminating a thread...

2009-03-02 Thread Mike Abdullah
Have you read the docs on -[NSThread cancel] ? Calling -cancel does NOT terminate the thread since this easily cause disastrous memory problems later down the line etc. Instead, your - convertDatabaseToSQLite3: method should periodically call [[NSThread currentThread] isCancelled] and finish

Re: "Pausing" other programs

2009-02-28 Thread Mike Abdullah
This is a standard Unix process feature and nothing to do with Cocoa; probably best asked elsewhere. Mike. On 28 Feb 2009, at 18:32, David Hatch wrote: Hi, I have a nice app called Blitz (blitzapp.com) which has the ability to focus on a single application, pausing the rest. Does anybody

Re: renaming a file with special/reserved characters in name

2009-02-26 Thread Mike Abdullah
Except it doesn't, because each filesystem is different. The above is true for HFS+, it is NOT true for FAT32, which has a whole bunch of other characters which are illegal. This is the bad news: there is NO way to tell what those characters are. It seems totally crazy that there isn't an A

Re: renaming a file with special/reserved characters in name

2009-02-26 Thread Mike Abdullah
On 26 Feb 2009, at 07:29, Martin Wierschin wrote: Hi Michael, I appreciate your reply, thank you. The first is the slash (/). Note, NOT a backslash (\), that one is fine. Slash is the path separator and thus can't exist in a filename. Whoops, quite right, my mistake. Except it doesn't, b

Re: Window Animation with setFrame:display:animate: Flickers

2009-02-21 Thread Mike Abdullah
Did you need to target anything pre-Leopard? If not, I'd recommend using Core Animation instead of this method. It'll have the advantage of being GPU-powered and more importantly won't block the main thread during the animation (I frequently try to move the System Prefs somewhere more conv

Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation

2009-02-19 Thread Mike Abdullah
On 19 Feb 2009, at 18:29, Leo Singer wrote: Sorry, I meant to send this to the list. Leo -- Forwarded message -- From: Leo Singer Date: Thu, Feb 19, 2009 at 1:28 PM Subject: Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation To: Greg Parker

Re: Question about the Foundation Framework

2009-02-19 Thread Mike Abdullah
On 19 Feb 2009, at 15:36, Michael Ash wrote: On Thu, Feb 19, 2009 at 9:15 AM, Michael wrote: My question, having seen that the author creates and then stores these unique names in the NSTemporaryDirectory, is **why** one would choose that directory over, say, some locally created directory

Re: Is there a known bug in NSUrl?

2009-02-18 Thread Mike Abdullah
I think the only way to get anywhere then is to build yourself a test case and see if it is at all reproducible. In particular, whether the bug lies in NSURLDownload or NSURLConnection (or maybe even WebDownload). On 18 Feb 2009, at 14:15, Robert Nicholson wrote: In the cases where I see t

Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation

2009-02-18 Thread Mike Abdullah
Would this work? - (void)main { [[NSThread currentThread] setStackSize:stackSize]; // Do usual work } Actually, with a bit more reading, apparently not. You'd need to set the stack size before starting the thread, not after. In which case your only option is to subclass NSOp

Re: Converting .wav files to MP3

2009-02-18 Thread Mike Abdullah
Phone. and as far i know IPhone does not support QTKit. Is there any alternative. On 18-Feb-09, at 3:13 PM, Mike Abdullah wrote: You almost certainly want QTKit. Read up on it in the documentation. On 18 Feb 2009, at 09:36, Anshul jain wrote: I am trying to convert the .wav files to MP3. I

Re: Converting .wav files to MP3

2009-02-18 Thread Mike Abdullah
You almost certainly want QTKit. Read up on it in the documentation. On 18 Feb 2009, at 09:36, Anshul jain wrote: I am trying to convert the .wav files to MP3. I have tried to google it. I found a framework called LAME. but i don't know to use it. Can anybody help me out. Thanks! Anshul

Re: Transparent Image

2009-02-11 Thread Mike Abdullah
Don't get your hopes up too much, plenty of issues remain unsolved for looong periods of time. You want http://bugreport.apple.com On 11 Feb 2009, at 20:41, Christian Graus wrote: Please file a bug and request this functionality. OK - that would not have occurred to me at all. That works in

Re: Objective-C question

2009-02-10 Thread Mike Abdullah
Read the documentation on -isKindOfClass: again. It does exactly what you want. -isMemberOfClass: performs the more specific test of excluding subclasses. On 10 Feb 2009, at 17:16, Andy Bettis wrote: I have an id object that I'd like to test to see if it's a certain class or a subclass of

Re: how to get iphone calendar database file

2009-02-07 Thread Mike Abdullah
You can't. Please file a bug report requesting it. On 7 Feb 2009, at 04:17, Ankur Diyora wrote: Hello all, I want iphone calendar database file(sqlite). How can i get this file from iPhone ? Thank you.. ___ Cocoa-dev mailing list (Cocoa-dev@lists.ap

Re: control app with help iphone?

2009-02-06 Thread Mike Abdullah
You want to read up on Bonjour. This is how Apple's Remote app detects copies of iTunes on the local network. On 6 Feb 2009, at 08:43, Carlo Gulliani wrote: good morning, everybody. Does anybody know how my app can receive command from iphone? for example, how appleremote app works from ap

Re: Saving application data in ~/Library/Application Support/

2009-02-05 Thread Mike Abdullah
On 5 Feb 2009, at 18:29, I. Savant wrote: On Thu, Feb 5, 2009 at 1:21 PM, Josh de Lioncourt wrote: There are several reasons we're not doing it this way. One is that our application data will be stored in a customized format that is *not* a .plist file, because we need to maintain cross-

Re: Saving application data in ~/Library/Application Support/

2009-02-05 Thread Mike Abdullah
Please, please, please do not store preferences in ~/Library/ Application Support/ They should go in ~/Library/Preferences Everything else is fine to go in app support. Apple provides both NSUserDefaults and CFPreferences APIs for storing your prefs, although you could do it manually if you re

Re: NSOpenPanel - disabling the "Open" button for certain folders.

2009-02-02 Thread Mike Abdullah
Sadly I'm pretty certain there's no API to disable the button. But you can fairly easily implement the -panel:isValidFilename: delegate method and return NO to stop the user opening a folder. Calling NSBeep() at the same time wouldn't be amiss I imagine. Mike. On 30 Jan 2009, at 01:18, Ron

Re: theoretical, can i use the same wave effect, which i can see when i adding new widget in dashboard?

2009-02-01 Thread Mike Abdullah
Dashboard uses Core Image to achieve the effect. You may also be able to do the same thing on Leopard using Core Animation. On 1 Feb 2009, at 18:24, Carlo Gulliani wrote: hi all, how can i use (make) the wave effect like in dashboard when i adding new widget? i'm trying to find info in googl

Re: change NSBorderlessWindowMask on NSTitledWindowMask when app is launch. how?

2009-01-29 Thread Mike Abdullah
:38, Carlo Gulliani wrote: i thought about it, but my app contain webView object, which is loading flash's animation. If i close first window and create new window with NSTitledWindowMask my flash animation is playing again from first frame. From: Mike Abdullah To: Carlo Gulliani

Re: change NSBorderlessWindowMask on NSTitledWindowMask when app is launch. how?

2009-01-29 Thread Mike Abdullah
1) Changing the UI like this is almost always a bad idea 2) You can't change the style of a window once launched. But, you can close the old window and replace it with a new one in exactly the same location. Mike. On 29 Jan 2009, at 10:25, Carlo Gulliani wrote: hi, everybody. I have a

Re: Check URL Status

2009-01-28 Thread Mike Abdullah
On 29 Jan 2009, at 00:30, Mr. Gecko wrote: but wouldn't that return the data of the file it self as well? Because I don't want the data because it's like 130MB and it'll take a long time to get the data just for a check... Which is precisely why the URL loading system is asynchronous by

Re: drag the whole window just by dragging the Image placed on it

2009-01-28 Thread Mike Abdullah
Look at -[NSView mouseDownCanMoveWindow] On 28 Jan 2009, at 09:07, Rahulkumar wrote: Few days ago I posted a querry that "I can move a Window i.e. a NSWindow object with the just a simple call [myWindow setMovableByWindowBackground:TRUE]. This makes window movable from every point I dr

Re: action on double click of image

2009-01-28 Thread Mike Abdullah
As a very cursory search with Google would have found you: http://www.google.com/search?client=safari&rls=en-gb&q=nsimageview+double+click&ie=UTF-8&oe=UTF-8 http://lists.apple.com/archives/Cocoa-dev/2007/Mar/msg00542.html Mike. On 28 Jan 2009, at 09:47, Rahulkumar wrote: Hi, I am trying to

Re: Forcing allocation of a subclass

2009-01-24 Thread Mike Abdullah
I would recommend against the category approach. As your search of the archives no doubt explained, there's no guarantee that PDFDocument may at some point internally use its own category that would override yours. I don't know exactly how you'd do what you want (+poseAsClass: is deprecated

Re: Setting the result of a javascript function to NSString

2009-01-21 Thread Mike Abdullah
WebKit has a full Obj-C DOM API which you can access starting at - [WebFrame DOMDocument] From there it should be fairly easy to locate your iframe and grab it's inner HTML. Mike. On 21 Jan 2009, at 13:56, Alex Mills wrote: Hey, The Javascript based editor is here http://www.alexmillsdesi

Re: Store value of qc color picker in plist

2009-01-21 Thread Mike Abdullah
Well, pretty much as the message says, a colour object is unsuitable for inclusion in a property list. I suggest you instead serialise it to an NSData object using NSKeyedArchiver/Unarchive. Mike. On 21 Jan 2009, at 09:31, Jonathan Selander wrote: I use a QCCompositionParameterView to manip

Re: Custom Cocoa Component/Control

2009-01-20 Thread Mike Abdullah
Trying to recreate this much behaviour yourself is almost certainly a bad idea. Instead, look into NSBrowser or NSCollectionView. Mike. On 20 Jan 2009, at 03:16, Paul Franz wrote: I know this is a noob question but I do not know where to look. I come for a Java background. So I know what to

Re: NSTextView and automaticLinkDetection

2009-01-20 Thread Mike Abdullah
You'll probably want to use Adium's AutoHyperlinks framework to achieve this. Much more flexible. http://trac.adiumx.com/wiki/AutoHyperlinksFramework Mike. On 20 Jan 2009, at 06:58, Steve Cronin wrote: Folks; NSTextView has an attribute 'automaticLinkDetection' that can be set in IB or wi

Re: "Cocoa Fundamentals Guide" Clarification

2009-01-19 Thread Mike Abdullah
Just write your code in Obj-C. When you have a finished application, then start profiling performance. If this shows that calling some methods is slowing things down, consider changing them to a function. However, note that you are rather unlikely to run into this. Message dispatch is prett

Re: Check URL Status

2009-01-19 Thread Mike Abdullah
Create a NSURLConnection for the HD URL. It will receive an NSHTTPURLResponse object with -statusCode 404. Mike. On 19 Jan 2009, at 01:20, Mr. Gecko wrote: Hello, I'm trying to find out how I can check a URL status in cocoa. I have two links to videos on a server one HD and one SD. sometime

Re: Properties and memory management with overrides.

2009-01-18 Thread Mike Abdullah
You're overriding the method, so it is up to you to implement the copying behaviour. On 18 Jan 2009, at 21:19, Sandro Noel wrote: Greetings. This is probably a stupid question. if i have a property declared as @property (readwrite, copy) NSString *name; if I override the -(void) setName(NS

Re: this class is not key value coding-compliant ...

2009-01-18 Thread Mike Abdullah
I would guess that your binding is to the the model ket "rootArray" and the controller key "selection" (or similar). The result is a combined keypath of "selection.rootArray", not "rootArray" as you expect. In IB, you should be able to just delete the controller key and solve the problem.

Re: WebView (Caching)

2009-01-15 Thread Mike Abdullah
On 15 Jan 2009, at 01:29, Rob Keniger wrote: On 15/01/2009, at 6:53 AM, Joseph Crawford wrote: When I drop a WebView on my XIB does it automatically cache the file(s) that it loads? I ask because I could not get a JS command to work properly even after I fixed the would be problem. This

Re: How can i read the "iTunes Library" file?

2009-01-12 Thread Mike Abdullah
As others have said, you need to read in the XML file. I suggest using our iMedia framework to do it for you: http://code.google.com/p/imedia/ On 11 Jan 2009, at 21:43, Luca wrote: I'd want to read the contents of the file iTunes stores in ~/Music/ iTunes/iTunes Library in my Cocoa Applicati

Re: NSImage resizing

2009-01-09 Thread Mike Abdullah
Try having a play with -[NSImage setScalesWhenResized:] On 9 Jan 2009, at 13:50, Parimal Das wrote: hi in my application i need to resize a .jpg image through a command line my code is NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:filePath]; // get icon from the file at filePa

Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?

2009-01-06 Thread Mike Abdullah
On 4 Jan 2009, at 06:17, Chunk 1978 wrote: *thread shocked back to life* since this timer i'm writing is based on NSDate, it's effected if the computer's clock is manually changed... that i don't mind, because who really need to ever manually set their clock on the computer... however, i'm con

Re: Memory Management to NSError

2009-01-06 Thread Mike Abdullah
You didn't create the error object, so don't release it. Assume it is autoreleased. On 6 Jan 2009, at 02:16, Dong Feng wrote: How shall we handle the NSError object returned directly or indirectly (through out parameter)? Shall it be released after use? I checked the example code in Apple doc

Re: -[CKConnection connect]

2008-12-30 Thread Mike Abdullah
My apologies everyone, somehow sent this to completely the wrong mailing list. It should have been to the ConnectionKit list, not cocoa- dev at all. Mike. On 30 Dec 2008, at 15:38, I. Savant wrote: On Tue, Dec 30, 2008 at 9:51 AM, Mike Abdullah wrote: What is the desired intent of the

-[CKConnection connect]

2008-12-30 Thread Mike Abdullah
What is the desired intent of the -connect method? If you call it while already connected, should it: A) Restart the connection -- In which case I need to update the header docs B) Do nothing -- In which case I need to make relatively small adjustments to the code ___

Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Mike Abdullah
plicationMain(argc, (const char **) argv); } Thanks for the help, Mr. Gecko On Dec 29, 2008, at 10:57 AM, Mike Abdullah wrote: Perhaps you could explain why you've felt the need to write a custom cookie storage system? I think it would help us figure the best solution. Bear in mind that NSHTTP

Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Mike Abdullah
Perhaps you could explain why you've felt the need to write a custom cookie storage system? I think it would help us figure the best solution. Bear in mind that NSHTTPCookieStorage's design is quite complicated in that it synchronises with all instances in other apps. Mike. On 29 Dec 2008,

Re: Replacing objects

2008-12-22 Thread Mike Abdullah
On 23 Dec 2008, at 00:30, WT wrote: On Dec 23, 2008, at 1:04 AM, Kyle Sluder wrote: On Mon, Dec 22, 2008 at 6:03 PM, WT wrote: Of course, the proxy object's class has to share the same interface as the class of the objects it represents so that your code doesn't need to know whether it'

Re: Saving the project

2008-12-22 Thread Mike Abdullah
Either NSWindow or NSWindowController have a -setDocumentEdited: method that will do what you want. On 22 Dec 2008, at 11:39, Mahaboob wrote: In my app I used NSTextView as editor and saves my project along with the contents of editor by using archiving and also I can open the saved projec

Using NSURL authentication APIs for non-standard protocols

2008-12-19 Thread Mike Abdullah
Has anyone had much luck using the NSURL authentication APIs for anything outside of http, https, ftp and ftps? The first problem I ran into is that when creating an NSURLProtectionSpace object, specifying "ftp" as the protocol gets converted to "ftps". Likewise, trying to use "ssh" -> "htt

Re: Listening for changes

2008-12-19 Thread Mike Abdullah
Since you apparently want to just know that one of the fields changed, but not which one specifically, why not just have the class post an NSNotification called MyClassDidChange or similar? Mike. On 19 Dec 2008, at 17:06, Andre Masse wrote: Let's say I have a class (called it Client) that h

Re: NSURL creation problem with colon: a partial workaround

2008-12-18 Thread Mike Abdullah
According to the RFC specs referenced by the NSURL documentation, the colon is a reserved character. You should percent escape it before using it as a relative path. I believe that would be: NSURL * url2 = [NSURL fileURLWithPath:@"/root/"]; NSURL * url3 = [NSURL URLWithString:@"file%3Atest" r

Re: batch processing

2008-12-16 Thread Mike Abdullah
NSFileManager has methods for iterating the contents of a directory. On 16 Dec 2008, at 11:43, 양승준 wrote: Hi, I would like to write a code to batch process files in a directory. I mean I would like to open, process, and store files one- by-one. My plan is to read names of files into a nsmutab

Re: More - Safari Download Security Alerts

2008-12-15 Thread Mike Abdullah
On 15 Dec 2008, at 16:53, Dave wrote: On 15 Dec 2008, at 16:31, Bill Bumgarner wrote: On Dec 15, 2008, at 7:29 AM, Dave wrote: I've being experimenting since I wrote the above. My installation consists of a folder that contains an application. I want the folder to be created in "/Applica

Re: More - Safari Download Security Alerts

2008-12-12 Thread Mike Abdullah
Does your app actually require an installer? If so, use Apple's built- in installer application; don't roll your own with AppleScript. If an installer is not really needed, just provide the application on its own inside the DMG file. Users can drag and drop it to their preferred destination.

Re: Depressed, Etched Style For Toolbar?

2008-12-10 Thread Mike Abdullah
Look at the various NSToolbar methods with "select" in their name. Search around with those for examples. On 10 Dec 2008, at 16:21, Chunk 1978 wrote: when validating a toolbar item, how do i call this style? (see image attached) ___ Cocoa-dev mai

Re: Searchable persistent file reference

2008-12-10 Thread Mike Abdullah
FSRef is the data type for referencing a particular file by record, however it's not the pleasant to work with. Have you considered using NDAlias etc. but setting them to resolve references by file ref, then path. (By default, the alias manager looks up aliases by path first, then file ref)

Re: NSDictionary mutability test

2008-12-08 Thread Mike Abdullah
On 8 Dec 2008, at 17:15, [EMAIL PROTECTED] wrote: There are a number of posts detailing with the ethics of the issue of determining an object's mutability. eg: http://www.cocoabuilder.com/archive/message/cocoa/2004/7/7/73 Does anyone have a current informed pragmatic opinion on how to dea

Re: Sheet opens but not attached to window

2008-12-08 Thread Mike Abdullah
In IB, your window is probably set to be visible at launch. Turn that off as you are managing the visibility yourself. Mike. On 8 Dec 2008, at 16:44, Mike Chambers wrote: I am trying to create a custom sheet for my application. The sheet is contained in a separate nib named "CalendarSheet",

Re: How to use NSWorkspace?

2008-12-08 Thread Mike Abdullah
On 8 Dec 2008, at 00:45, Rob Keniger wrote: On 08/12/2008, at 10:07 AM, John Velman wrote: I want to use NSWorkspace to open an application from a command line Foundation Tool. You probably don't want to use NSWorkspace to do this. You should use NSTask to run command line tools. I'

Re: How to use NSWorkspace?

2008-12-07 Thread Mike Abdullah
NSWorkspace is part of AppKit, so you need to link against that, not just Foundation. Alternatively, you could drop down directly to the Launch Services functions. On 8 Dec 2008, at 00:07, John Velman wrote: I'm missing something obvious, but I don't know what. I want to use NSWorkspace t

Re: 3-float struct?

2008-12-07 Thread Mike Abdullah
The closest you'll find I think is the CIVector class. Mike. On 7 Dec 2008, at 20:19, Dave DeLong wrote: Of course you could. But it's not uncommon to need a 3 dimensional coordinate, so we were just wondering if there's one built in. Obviously 2 dimensional coordinates are everywhere, an

Re: How to disable the transparency in dropdown sheets?

2008-12-07 Thread Mike Abdullah
Why do you want to do this? Why do you want your app to be different to all others on the system? That said, NSWindow does have a - setAlphaValue: method, does setting that before or after starting the sheet achieve anything? Mike. On 7 Dec 2008, at 15:41, Arun wrote: Hi I am displaying

Re: core data + undo + to-many relationship

2008-12-07 Thread Mike Abdullah
Core Data is specifically designed not to invoke accessor methods when undoing or redoing changes. For efficiency, it just rolls back the state of the objects. It does NOT perform the reverse of your original actions. Of course, during an undo/redo, KVO notifications are fired, so your UI s

Re: Override load/save for NSDictionary ?

2008-12-05 Thread Mike Abdullah
Rather than subclassing, you're much better off using a category along these lines: @interface NSDictionary (CustomDataFormat) - (id)initWithCustomData:(NSData *)data; - (id)initWithCustomDataContentsOfURL:(NSURL *)URL; - (NSData *)customData; - (BOOL)writeToURL:(NSURL *)URL atomically:(BOOL)a

Re: NSPersistentDocument packages update

2008-12-03 Thread Mike Abdullah
My advice is not to bother. Just subclass NSDocument directly and implement the Core Data side of things there. It really isn't too much work. Mike. On 3 Dec 2008, at 09:42, Paul Tomlin wrote: I'm looking for the current best practice for convincing NSPersistentDocument to work with docum

Re: NSImageView antialiasing when scaling up images

2008-12-02 Thread Mike Abdullah
You'll want to subclass NSImageView and implement your own -drawRect: method. Call super's implementation, but beforehand, do something like: [[NSGraphicsContext currentContext] set setImageInterpolation: NSImageInterpolationNone]; On 2 Dec 2008, at 23:45, Jonathon Kuo wrote: I have some t

Re: set position of alert panel

2008-11-26 Thread Mike Abdullah
I'd advise against this. Either accept the standardised system behaviour, or use a sheet instead. That said, NSAlert has a -window method. You should be able to grab the window with that and place it wherever you like using - setFrame:display: Mike. On 25 Nov 2008, at 11:49, Nishad Kumar

Re: Ftp

2008-11-25 Thread Mike Abdullah
You'll probably be wanting ConnectionKit: http://opensource.utr-software.com/connection/download.html On 25 Nov 2008, at 15:58, Filip van der Meeren wrote: I am currently working on a new sourceforge-project: "PerlManager", to manage the installation and management of all the Perl-versions

Re: NSOpenPanel Preview

2008-11-24 Thread Mike Abdullah
You want to write a Quick Look generator. http://developer.apple.com/documentation/UserExperience/Conceptual/Quicklook_Programming_Guide/Introduction/chapter_1_section_1.html#/ /apple_ref/doc/uid/TP40005020-CH1-DontLinkElementID_5 On 24 Nov 2008, at 22:36, David Blanton wrote: I have a custom

Re: Call getElementById in Cocoa

2008-11-24 Thread Mike Abdullah
On 24 Nov 2008, at 17:28, Jean-Daniel Dupas wrote: Le 24 nov. 08 à 18:03, Mike Abdullah a écrit : On 24 Nov 2008, at 16:45, John Terranova wrote: On Nov 24, 2008, at 8:11 AM, Jean-Daniel Dupas wrote: You call -mainFrameDocument on your WebView to get a DOMDocument instance, and have

Re: Call getElementById in Cocoa

2008-11-24 Thread Mike Abdullah
On 24 Nov 2008, at 16:45, John Terranova wrote: On Nov 24, 2008, at 8:11 AM, Jean-Daniel Dupas wrote: You call -mainFrameDocument on your WebView to get a DOMDocument instance, and have access to the DOM functions from here (there is no up-to-date doc of the Cocoa DOM API, you will have t

Re: Problem archiving/unarchiving object graph containing NSMutableArray

2008-11-21 Thread Mike Abdullah
You're almost certainly going to need to post some code for us to figure it out. On 21 Nov 2008, at 13:12, Mikael Wämundson wrote: Hi experienced developers! I'm trying to archive/unarchive an object graph using archivedDataWithRootObject: aRootObject. aRootObject has two instance variable

Re: Crash in AppKit/CoreFoundation?

2008-11-18 Thread Mike Abdullah
A crash in _CFDictionaryGrow suggests to me that your app has used up all the memory available to it. Does anything in your user's console log indicate this? If you're doing batch operations on a background thread, are you sure it's managing its memory properly? On 18 Nov 2008, at 03:30, Ke

Re: newbie NSMutable dictionary subclass question

2008-11-17 Thread Mike Abdullah
As a self-professed newbie, you almost certainly shouldn't be subclassing NSMutableDictionary. Can I ask your reasons for doing so? On 17 Nov 2008, at 00:25, Bob Sabiston wrote: Can the value part of a key-value pair in an NSMutableDictionary be a literal NSString, like @"name"? It would s

Re: Archiving NSError

2008-11-16 Thread Mike Abdullah
Have a look at the documentation for -writeToFile:atomically: In particular this quote: "This method recursively validates that all the contained objects are property list objects (instances of NSData, NSDate, NSNumber, NSString, NSArray, or NSDictionary) before writing out the file, and

Re: NSDocument annoying warning

2008-11-14 Thread Mike Abdullah
I would suggest that you rearrange your code slightly to match how the document architecture expects it to operate. Move your package-modification code to be part of the -writeToURL: or - saveToURL: method of your document subclass. Then, when opening a document, check if the upgrade needs d

Re: Retain

2008-10-24 Thread Mike Abdullah
Yeah, but I figured that's more of a minor detail. When you're getting started you just don't want it to crash; doesn't matter too much when the crash actually occurs. On 24 Oct 2008, at 16:33, Dave Carrigan wrote: On Oct 24, 2008, at 8:23 AM, Mike Abdullah wrote: NS

Re: Retain

2008-10-24 Thread Mike Abdullah
This sort of question comes up every couple of weeks. You did not use +alloc to create the string, so you do NOT need to release it. If you try to release it, the app will crash. Any of these are correct: NSString w = [NSString stringWithFormat:@"something %i", x]; // Do stuff NSString w =

Re: commitEditing

2008-10-23 Thread Mike Abdullah
Try using the asynchronous version: commitEditingWithDelegate:didCommitSelector:contextInfo: It should display an alert with the error. On 22 Oct 2008, at 23:15, Chris Idou wrote: I'm calling commitEditing on a NSObjectController, and its returning NO, for no apparent or obvious reason.

Re: How can I find app bundle with its identifier. App is not running.

2008-10-17 Thread Mike Abdullah
Look at NSWorkspace, it has a number of methods for locating applications by bundle identifier. On 17 Oct 2008, at 09:38, Alexander Shmelev wrote: Hello, I have to find application bundle with its identifies, but [NSBundle bundleWithIdentifier: ] searches only among running bundles. Is t

Re: Converting from HTML

2008-10-17 Thread Mike Abdullah
On 17 Oct 2008, at 03:17, Drarok Ithaqua wrote: Hi all, i'm trying to find a way to convert an HTML-originated URL into one I can use in cocoa. Example input: href="/search/unique&stuff&here" /> I know the URL that this data is fetched from, so I can prefix that to achieve a full URL agai

Re: How to get icon of special folder (like /Applications or /Library)?

2008-10-16 Thread Mike Abdullah
[[NSWorkspace sharedWorkspace] iconForFile:path] On 16 Oct 2008, at 16:08, Alexander Shmelev wrote: Hello, On Mac OS X many special folders have their own personal icons. For example "/Applications" have capital letter "A" on generic folder icon. I have some path which leads to some spec

Re: NSView subclass

2008-10-15 Thread Mike Abdullah
You should really name your category. Something like: @interface NSObject (MyViewDelegate) Even better if you're targeting Leopard only is to use a formal protocol, but with optional methods. e.g. @protocol MyViewDelegate @optional - (void)pointClicked:(NSPoint)point; @end On 15 Oct 2008, a

Re: Comparing the Class

2008-10-15 Thread Mike Abdullah
On 15 Oct 2008, at 14:20, Ruotger Skupin wrote: Hi, when comparing the class of two objects I usually do [obj1 isKindOfClass:[obj2 class]]. But if I say have the Class as an input value to a method: - (void) bla:(Class) inClass { if (/* inClass is an NSString */) {

Re: NSSet primitive methods

2008-10-11 Thread Mike Abdullah
Can I enquire as to why you wish to subclass it? On 11 Oct 2008, at 15:15, Glen Low wrote: Hi All I want to subclass the class cluster of NSSet. The documentation for the class clusters NSArray/NSMutableArray and NSDictionary/NSMutableDictionary clearly shows what the primitive methods ar

Re: NSPersistentDocument No Support "Save To" ("Save As"?)

2008-10-08 Thread Mike Abdullah
On 8 Oct 2008, at 20:48, chaitanya pandit wrote: Hi, I have implemented Save As... in one of my core data app. What i do is, in the "saveToURL: ofType: forSaveOperation: error:" method, if the save operation is NSSaveAsOperation, i migrate the persistent store to a new location given by

Re: Downloading with NSData and NSFileManager

2008-10-07 Thread Mike Abdullah
If you want to literally just download a file, the simple option is to use NSURLDownload. It's fairly straightforward, an asynchronous. On 6 Oct 2008, at 18:04, Mark Thomas wrote: Hi All, I was looking at downloading some files, and started to look at NSFileManager to create the file, and th

Re: Core Data undo grouping

2008-10-03 Thread Mike Abdullah
I agree with Ben that this seems somewhat odd to do, but that said: NSManagedObjectContext coalesces changes for registering with the undo manager, but NSUndoManager also performs its own grouping. - processPendingChanges just provides a means for forcing the MOC to register its changes when

Re: Passing focus to a control

2008-09-29 Thread Mike Abdullah
Directly quoting the -becomeFirstResponder: docs: Use the NSWindow makeFirstResponder: method, not this method, to make an object the first responder. Never invoke this method directly. Also, it's called a method, not a function. On 29 Sep 2008, at 09:36, Cocoader wrote: I have a window of

Re: How to get Safari Bookmarks in the code

2008-09-29 Thread Mike Abdullah
You could look into the bookmarks portion of our imedia framework: http://code.google.com/p/imedia/ Mike. On 29 Sep 2008, at 14:39, SridharRao M wrote: Hi All, I am creating a application that needs to display Safari Bookmarks. Is there any way to get safari bookmarks. Please help me in thi

Re: Setting automatic alignment

2008-09-29 Thread Mike Abdullah
On 29 Sep 2008, at 00:51, Felipe Monteiro de Carvalho wrote: Hello, Is it possible to have a control automatically expand as the window is resized? I have a toolbar and a text area and I would like the text area to automatically increase size as the window is resized. Is there a clever pr

Re: Image processing in Cocoa

2008-09-24 Thread Mike Abdullah
On 24 Sep 2008, at 10:50, Christian Giordano wrote: Hi guys, is there some good tutorial around about how to manipulate bitmaps in Cocoa? I would be interested on: - copy portion of image over another with a mask (this should be pretty straight forward with quartz2d) [[NSImage alloc] initWi

Re: NSArchiver and NSKeyedArchiver

2008-09-22 Thread Mike Abdullah
Your archiving code could do it's own check for -[coder allowsKeyedCoding] and log/raise an exception if not. On 22 Sep 2008, at 04:21, D.K. Johnston wrote: I wrote a class that conforms to the NSCoding protocol. I used encodeObject:forKey and decodeObjectForKey: in the required methods.

Re: structs in Mutable containers

2008-09-16 Thread Mike Abdullah
What's wrong with +[NSValue valueWithCGPoint:CGPointMake(x, y)] ? On 16 Sep 2008, at 13:41, Phil wrote: On Tue, Sep 16, 2008 at 10:46 PM, Christian Giordano <[EMAIL PROTECTED]> wrote: I just realized valueWithPoint is not available on the iPhone SDK It's just a convenience method for some

Re: Custom Array/Set keypath

2008-09-09 Thread Mike Abdullah
Create a custom NSValueTransformer subclass that takes the data and calculates its standard deviation On 9 Sep 2008, at 16:22, Jamie Phelps wrote: I would like to bind the value of an NSTextField to the standard deviation of a keypath. My class Foo has an instance variable "amount." I fou

Re: new to Cocoa -- threading question

2008-09-07 Thread Mike Abdullah
Also, if you're just playing an MP3 file, look into using QTKit on the main thread. Should be very much simpler and Objective C. On 7 Sep 2008, at 02:35, John Michael Zorko wrote: Hello, all ... I'm new to Cocoa, and i'm trying to launch a thread. Yet, the app bombs when I try, and the c

Re: How to create a GUID?

2008-09-06 Thread Mike Abdullah
CFUUIDCreate() followed by CFUUIDCreateString() Mike. On 6 Sep 2008, at 22:39, Meik Schuetz wrote: Dear everyone, I feel kind of embarrassed to ask, but could someone lead me the way on how to create an globally unique ID (such as for example d73e066c-cc88-4d66-be42-94dc091bb571) ? Best

Re: NSProgressIndicator drawing

2008-09-04 Thread Mike Abdullah
Are you making the progress indicator a subview of the picture? If not, that would explain your screenshot. On 4 Sep 2008, at 13:29, Marcel Borsten wrote: I'm using a NSProgressIndicator in my interface, but it shows some strange edges around it when it is visible. The progress indicator i

Re: textfield validation / formatter: emailaddress

2008-09-02 Thread Mike Abdullah
You want to use either an NSFormatter subclass, or possibly, if using bindings, key-value validation. On 2 Sep 2008, at 20:29, Joeles Baker wrote: hi, is there any easy way to validate a textfield? my app has a textfield, which should only accept emailaddresses. before I start reinventing t

<    5   6   7   8   9   10   11   >