Re: notAKeyMarker crash

2012-03-05 Thread Mike Abdullah
-[OAApplication beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:] That's definitely not part of Cocoa! You have the source. Dig in to find the problem. On 5 Mar 2012, at 15:15, Gideon King wrote: > Hi, I am getting occasional reports of an exception from users of my > softw

Re: NSURLRequests and Firewalls

2012-03-05 Thread Mike Abdullah
On 5 Mar 2012, at 19:21, Alex Zavatone wrote: > I just found out why some JSON parsing was failing, the data returned from > the NSURLRequest was the HTML for our firewall authentication page. You mean NSURLConnection right? URL requests themselves are purely data objects, they don't do any ne

Re: Question about KVC-compliance and bindings

2012-02-28 Thread Mike Abdullah
On 28 Feb 2012, at 17:05, Keary Suska wrote: > I find it more useful to focus on KVO (Key Value Observing) compliance rather > than KVC compliance, as although KVC compliance ensures KVO compliance, the > reverse is not always true. Whoah! Wrong way round! To be KVO-compliant, you must be KVC

Re: NSFileWrapper Role

2012-02-25 Thread Mike Abdullah
As an added advantage on top of that it can avoid loading existing files into memory until needed. This is particularly handy when writing document packages as those files can be written quickly as hard links, rather than loading into memory and writing out afresh. Sent from my iPad On 25 Feb

Re: feature request: implement a true checkbox in iOS

2012-02-24 Thread Mike Abdullah
This really isn't the place for feature requests. File a radar instead. On 24 Feb 2012, at 02:44, William Squires wrote: > Ever since the first release of iOS (then called iPhone OS), the UISwitch has > really bothered me: > > 1) It takes up too much valuable screen real-estate compared with a

Re: Crash when scroll down UITableView

2012-02-24 Thread Mike Abdullah
What's the backtrace? http://whathaveyoutried.com/ ? Instruments? On 19 Feb 2012, at 15:50, Vavelin Kevin wrote: > Hi all, > > I'm Vavelin Kevin and i'm student at Supinfo International University. I try > to develop an application for my uni and i have something wrong on my app. > When i scro

Re: Can't create window context…crash

2012-02-23 Thread Mike Abdullah
Sent from my iPad On 22 Feb 2012, at 10:17 PM, Gideon King wrote: > Hi all, I am seeing quite a number of reports from users of my software where > on the console, there are errors like the ones below, but I haven't been able > to reproduce the problem here: > > 2012-02-21 23:49:05 +0800[3]

Re: Choosing correct ArrayController depending on active TableView

2012-02-23 Thread Mike Abdullah
The windows's first responder will tell you if one of the table views has focus. If there are other UI elements in the window which can have focus though, this won't be good enough. Instead you'll have to start tracking the first responder yourself and recording which table had it last Sent fro

Re: initWithCoder: unrecognized selector

2012-02-19 Thread Mike Abdullah
What are the specifics of the crash? Anything in the console? What's the stacktrace? On 19 Feb 2012, at 21:44, Rick Mann wrote: > Hi. I've got a "Message" class that implements NSCoding. When > NSKeyedUnarchiver tries to create it, my app crashes with an unrecognized > selector error. > > If

Re: copy & isEqual nightmares

2012-02-17 Thread Mike Abdullah
On 17 Feb 2012, at 20:33, Ben Kennedy wrote: > On 16 Feb 2012, at 3:54 pm, Ken Thomases wrote: > >> In other words, you're being silly. It's clear to everyone that -[NSString >> isEqual:] must have semantics built on -[NSString isEqualToString:], which >> is clearly documented. > > What valu

Re: Block Behavior

2012-02-15 Thread Mike Abdullah
Give us the full details. What specific error are you seeing? On 15 Feb 2012, at 20:14, koko wrote: > I need to know why a line of code that is OK outside a Block is invalid > inside. > > > > = >[sp beginSheetModalForWindow:[self window] completionHandler:^(NSInteger > r

Re: receptionist pattern question: NSOperationQueue vs. GCD

2012-02-15 Thread Mike Abdullah
Because it's a higher-level API answers pretty much all your questions. You have a little more easy flexibility with what you can do to an NSOperationQueue compared to raw GCD. To put it another way, what downside are you seeing to using NSOperationQueue? On 15 Feb 2012, at 19:32, Matt Neuburg

Re: CGContextSaveGState

2012-02-15 Thread Mike Abdullah
On 15 Feb 2012, at 19:22, William Squires wrote: > Does this method store the context state in a stack, or just store it in a > local variable (struct) somewhere (i.e. does calling this more than once > overwrite the previously saved context info?) To quote the docs: "Each graphics context ma

Re: Sandbox - Security Scoped URLs (10.7.3)

2012-02-15 Thread Mike Abdullah
On 15 Feb 2012, at 07:13, Seth Willits wrote: > So 10.7.3 added URLs you can restore in a sandboxed process after relaunch > (AKA, needed by tons of apps that will be sandboxed), but I can't get them to > work. > > http://www.opensource.apple.com/source/CF/CF-635.19/CFURL.h > > Whenever I try

Re: ARC in Snow Leopard?

2012-02-12 Thread Mike Abdullah
On 12 Feb 2012, at 02:49, Kyle Sluder wrote: > On Feb 11, 2012, at 3:56 PM, Charles Srstka wrote: > >> On Feb 11, 2012, at 5:25 PM, William Squires wrote: >> >>> is ARC a Lion-only feature or will an ARC-compiled app work on 10.6.8 >>> assuming no other Lion features are used? >> >> Everythi

Re: Lion: Lock documents and custom undomanager

2012-02-11 Thread Mike Abdullah
On 11 Feb 2012, at 03:17, Quincey Morris wrote: > On Feb 10, 2012, at 15:03 , Mike Abdullah wrote: > >> My line of thinking: >> >> Each time one of your undo managers is about to close its top-level group, >> register that with the doc's main undo manager. T

Re: Lion: unlocking a document

2012-02-10 Thread Mike Abdullah
On 7 Feb 2012, at 11:08, Georg Seifert wrote: > Hi, > > I still have problems with my document saving behavior in Lion. > > If I open a file that my app can only read (CFBundleRoleType = Viewer) the > state is set to locked. If I unlock it and do some changes, the autosave > replaces the doc

Re: Lion: Lock documents and custom undomanager

2012-02-10 Thread Mike Abdullah
On 7 Feb 2012, at 11:28, Georg Seifert wrote: > Hi, > > I have several undomanagers in my app. (I know that is unusual. Think of it > as if you had a page layout app and every page has its own undo.) > > This all works well except if the document is locked. Then the documents > undomanager kn

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-10 Thread Mike Abdullah
On 10 Feb 2012, at 21:25, Gilles Celli wrote: > Opening the ASCII file can take up to 15-20 sec ( > 150MB), so I made some > changes as you suggested by moving the progressWindowController alloc/init > before the allocation of asciiFileContents... > And you're right I should have put addWindow

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-10 Thread Mike Abdullah
> I'm sure I'm doing something wrong here :-( > > Any clues ? Yep, here we go: On 10 Feb 2012, at 15:28, Gilles Celli wrote: > In my NSDocument readFromURL:ofType:error: method it init's a progressLoading > WindowController (which shows up the window with progress bar and Cancel > button). >

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Mike Abdullah
On 9 Feb 2012, at 20:23, Gilles Celli wrote: > Mike, Kyle, > > Thanks for the quick answers! > > Yes I'm targeting Mac OS X 10.6 and later so > canConcurrentlyReadDocumentsOfType: is a welcome addition, I completely > forgot that. > > Strangely if I put the method canConcurrentlyReadDocument

Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?

2012-02-09 Thread Mike Abdullah
Set an ivar in your document which the read method checks periodically. If the user cancelled, then return NO with an NSUserCancelledError. On 9 Feb 2012, at 16:01, Gilles Celli wrote: > Hi, > > I searched the mailing-list but didn't find an answer….so sorry if this was > posted before: > > I

Re: Blocks and Methods...

2012-01-28 Thread Mike Abdullah
On 28 Jan 2012, at 05:32, R wrote: > I'm writing code in for iOS 5 > > Ok, in my async com class, I'm receiving a block in one method and > want to execute it in the another method. I've concluded that I need > to place the block in a property. The only way that has worked is via > copy. >

Re: Versions, -windowWillClose:

2012-01-21 Thread Mike Abdullah
On 3 Jan 2012, at 15:25, Martin Hewitson wrote: > Dear list, > > I'm investigating getting the new 10.7 Versions stuff working on my > NSPersistentDocument app. In doing that, I've seen a couple of strange things > which I wanted to check on. > > Firstly, all I've done to make it work is to

Re: When in Versions browser

2012-01-21 Thread Mike Abdullah
On 21 Jan 2012, at 09:33, Martin Hewitson wrote: > Dear list, > > I'm trying to get Versions and autosave working on my document app. Most > things are working. I'm using the window delegate methods > > - (void)windowWillEnterVersionBrowser:(NSNotification *)notification; > - (void)windowDidEx

Re: Formatter for angle display?

2012-01-18 Thread Mike Abdullah
On 17 Jan 2012, at 16:38, Vincent Habchi wrote: > Sean, > >> NSNumberFormatter does not support that. But writing such a custom >> formatter would be a few dozen line of code, and pretty straightforward. > > I agree this is fairly simple; I just wanted to avoid the task altogether! :) > > BT

Re: Adding an observer to an NSOperation crashes my app.

2012-01-14 Thread Mike Abdullah
Your code snippet got mangled making it very hard for me to read. Please can we have a full backtrace for the crash. Is there anything interesting in the console? Have you tried running with zombies enabled? On 14 Jan 2012, at 07:30, G S wrote: > Hi all. Working on an iPhone app and encountere

Re: checking if directory is writable

2012-01-10 Thread Mike Abdullah
In order of preference, the best technique last: 1. -attributesOfItemAtPath:error: — can only give you some info info on if the file is writable 2. -isWritableAtPath: — takes more into account, but can't be sure. Gives you no details on *why* isn't wri

Re: MVC Theory Question

2011-12-29 Thread Mike Abdullah
On 28 Dec 2011, at 17:05, Philip McIntosh wrote: > > I am just wondering about something with respect to the Model-View-Controller > (MVC) design pattern. Should any validation of input or output be done by the > model class which is handling and processing the data, or is validation more > p

Re: Times to not add a document to NSDocumentController?

2011-12-27 Thread Mike Abdullah
On 27 Dec 2011, at 04:25, Rick Mann wrote: > I'm working on a CAD app that has a library of parts that can be added to a > document. Internally, I have a LibraryDoc to open library files, and present > the library UI windows. But I don't really want it to behave like a "regular" > document in

Re: NSString looses Umlaute

2011-12-22 Thread Mike Abdullah
On 22 Dec 2011, at 15:54, Alexander Reichstadt wrote: > Thanks, but I have not tried. My thinking went along the lines of if I read > the string directly from the URL I have no control over what encoding is > being used for reading or it defaults to something. If I first read as data, > I can

Re: Debugging hints

2011-12-22 Thread Mike Abdullah
On 22 Dec 2011, at 14:03, Martin Hewitson wrote: > > On 22, Dec, 2011, at 02:39 PM, Mike Abdullah wrote: > >> Did you actually write this app to be dual-mode, or are you under the >> impression that turning off garbage collection will magically fix things? > > To

Re: NSString looses Umlaute

2011-12-22 Thread Mike Abdullah
On 22 Dec 2011, at 09:59, Alexander Reichstadt wrote: > Thanks, it works. The following solved the problem, where theChoice is a URL > to a local file from an NSOpenPanel: > >NSData *theData = [NSData dataWithContentsOfURL:theChoice]; >NSString *theContent = [[NSString alloc] in

Re: Debugging hints

2011-12-22 Thread Mike Abdullah
Did you actually write this app to be dual-mode, or are you under the impression that turning off garbage collection will magically fix things? Going by the stack trace, this is a classic zombie. Use Instruments to find the bug. On 22 Dec 2011, at 10:48, Martin Hewitson wrote: > Dear list, >

Re: Lion: Batch close

2011-12-21 Thread Mike Abdullah
You've given us almost nothing to go on. Can we have a crash report please? Have you tried using Instruments to look for zombies? Indeed, have you tried anything at all? On 21 Dec 2011, at 06:00, Appa Rao Mulpuri wrote: > Hi, > > My application is crashing on Lion if user tries to close all op

Re: responding to NSStepper clicks

2011-12-18 Thread Mike Abdullah
On 18 Dec 2011, at 17:08, Koen van der Drift wrote: > Just to be sure I'm doing this correctly in my code I extract the number from > my textfield and stepper as follows: > > NSUInteger index = [ indexTextField integerValue]; > > and/or > > NSUInteger index = [indexStepper integerValue];

Re: responding to NSStepper clicks

2011-12-18 Thread Mike Abdullah
On 17 Dec 2011, at 11:29, Koen van der Drift wrote: > > On Dec 16, 2011, at 11:48 PM, Quincey Morris wrote: > >> There are various solutions you might choose, depending on how you expect to >> handle validation errors for your text field. You can add a number formatter >> to the field, or you

Re: responding to NSStepper clicks

2011-12-16 Thread Mike Abdullah
Your text field is is bound to the model/a controller right? If so, you want the "updates immediately" binding option. On 16 Dec 2011, at 12:59, Koen van der Drift wrote: > On Thu, Dec 15, 2011 at 10:50 AM, Koen van der Drift > wrote: >> On Thu, Dec 15, 2011 at 1

Re: Mysterious "File exists" message logged to console

2011-12-15 Thread Mike Abdullah
On 15 Dec 2011, at 19:55, Richard Somers wrote: > On Dec 15, 2011, at 8:29 AM, Mike Abdullah wrote: > >> I'm trying to track down a bug and have a copy of a customer's console log >> to help me. There's rather a lot of messages like this: >> >>

Mysterious "File exists" message logged to console

2011-12-15 Thread Mike Abdullah
Hello, I'm trying to track down a bug and have a copy of a customer's console log to help me. There's rather a lot of messages like this: open on /Users/foo/bar/mydocument.package/DSC_0221.jpg: File exists Searching the web has been fruitless so far, so does anybody know which Cocoa AP

Re: responding to NSStepper clicks

2011-12-15 Thread Mike Abdullah
NSStepper is a subclass of NSControl. Hook up its action/target to be notified when it's adjusted. On 15 Dec 2011, at 13:16, Koen van der Drift wrote: > I've set up an NSStepper/NSTextField combination to control myInt in > my model. I have bound the value of myInt to both outlets, and when I >

Re: WebView (Mac) Scroll - quick question

2011-12-12 Thread Mike Abdullah
That depends on what you mean by "when the scrollbar moves". The user scrolls? Or they click a link which causes the page to scroll? Perhaps both? Note also that there's a dedicated webkit-sdk mailing list which these kind of questions are best targeted towards. On 12 Dec 2011, at 12:20, Ben wr

Re: iOS: How to hide blue personal hotspot status bar?

2011-12-08 Thread Mike Abdullah
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/setStatusBarHidden:withAnimation: On 7 Dec 2011, at 23:40, Eagle Offshore wrote: > Angry Birds does it so it must be possible. So how can I do th

Re: How to force WebView to use a separate NSHTTPCookieStorage ?

2011-11-30 Thread Mike Abdullah
On 30 Nov 2011, at 12:00, Ben wrote: > I am writing an app which opens up multiple WebView's of the same web site. > The problem I'm having is that the website detects that I already have a page > open and closes the previously opened page. > > So I'm presuming that the method by which it is

Re: Resizable borderless windows in Lion

2011-11-17 Thread Mike Abdullah
On 17 Nov 2011, at 17:36, Jens Alfke wrote: > > On Nov 17, 2011, at 2:33 AM, Nicholas Francis wrote: > >> Reading the Lion release notes, it says I should create my window with >> NSBorderlessWindowMask | NSResizableWindowMask. It also says that my app >> needs to be compiled with Lion as a b

Re: Witch controls to use to implement an Xcode (4.2) like "toolbar view"

2011-11-14 Thread Mike Abdullah
Based on the behaviour in Xcode, they've almost certainly implemented it as an NSMatrix, much like the tabs in iWork Inspectors too. On 14 Nov 2011, at 15:49, Jean-Daniel Dupas wrote: > > Le 14 nov. 2011 à 16:06, DELHAISE Thierry a écrit : > >> Hi All, >> >> Just wondering if someone have tri

Re: NSArray, NSDictionary property attribute issue, retain or copy?

2011-11-13 Thread Mike Abdullah
You should indeed declare such properties as copy. Some people seem to assume that the copy will copy the contents of the collection, which certainly isn't true. Of course for NSArray, it's often more appropriate to have a readonly array property, with KVC-compliant methods for inserting and rem

Re: Best way to determine whether iTunes is installed or not on Mac

2011-11-10 Thread Mike Abdullah
The bundle identifier is the right thing to base your check on. Show us your code and we'll be able to tell you if you're dong anything wrong Sent from my iPad On 10 Nov 2011, at 05:01 AM, Vaibhao Mahore wrote: > Hello, >I would like to know best way to determine whether iTune

Re: So… no NSOtulineView Drag and Drop with NSTreeController?

2011-11-09 Thread Mike Abdullah
On 9 Nov 2011, at 22:17, Gustavo Pizano wrote: > Hello all. > > I have been looking for some guidance or light on this matter, > > The closest I was able to find was this page: > > http://theocacao.com/document.page/130 > > but then checking on Apple mail list I read some comments that the a

Re: Changing the appearance of buttons

2011-11-08 Thread Mike Abdullah
Mac or iOS? On 8 Nov 2011, at 18:52, Tom Jeffries wrote: > This is probably an elementary question. I need to change the bitmaps used > for buttons. Is there a way to do that with buttons created using > Interface Builder or do I need to create a new class that gives me control > of the bitmaps

Re: Core Data loading faulted object?

2011-11-04 Thread Mike Abdullah
On 4 Nov 2011, at 00:29, Rick Mann wrote: > Mike, > > Did you have any speculation as to why this might be happening? Not especially, I mostly asked since it's an important detail which might prompt others. Have you any delete rules which are set to "No action"? _

Re: Adventures in core-data, iCloud, and sandboxing

2011-11-04 Thread Mike Abdullah
On 4 Nov 2011, at 01:01, Roland King wrote: > > > > >> So, can I conclude from this that iCloud and core-data only works with SQL >> store? The WWDC video hints at this, but was not explicit. >> > > Not so. I have a core data app running using icloud and an XML store. This is > ios by the

Re: Speeding up image drawing?

2011-11-01 Thread Mike Abdullah
On 1 Nov 2011, at 01:44, Arbit Richardi wrote: > I'm looking for tips to speed image drawing on OS X — this is a > primary function of my application. I started out naively with > NSImage, switched to CGImage, tried layer backing, and now draw > directly into a hosted layer with Quartz. I have an

Re: Core Data loading faulted object?

2011-10-31 Thread Mike Abdullah
What store type are you using? On 31 Oct 2011, at 22:06, Rick Mann wrote: > Hi. I'm seeing a situation where my app starts up, fetches all instances of a > particular entity (which is just one), and that object ends up being a fault. > This is right after startup, although instances were delete

Re: Core Data: Determine if managed object is deleted

2011-10-22 Thread Mike Abdullah
On 22 Oct 2011, at 05:35, Jerry Krinock wrote: > In my world, -retainedObjectHasBeenDeleted is only going to be invoked in > corner cases, but documentation states that -prepareForDeletion is invoked > "when the receiver is about to be deleted". That may be quite often in some > use cases. A

Re: Core Data: Determine if managed object is deleted

2011-10-21 Thread Mike Abdullah
On 20 Oct 2011, at 23:37, Jerry Krinock wrote: > When I need to know whether or not a managed object is deleted, often I fall > into the trap of trying -[NSManagedObject isDeleted], forgetting that its > documentation states … > > "… It may return NO at other times, particularly after the obj

Re: How to get rid of blinking?

2011-10-19 Thread Mike Abdullah
On 19 Oct 2011, at 18:41, Nick wrote: > Hello > Could you advice me how to get rid of blinking in the following code? > This is an NSView's subclass, I am trying to draw a rectangle for zooming > (theoretically a user is supposed to be able to zoom in a piece of a view, > by selecting a rectangle

Re: NSArrayController Update Delay

2011-10-17 Thread Mike Abdullah
On 17 Oct 2011, at 22:22, Richard Somers wrote: > SOLVED > > On Oct 13, 2011, at 4:55 PM, Mike Abdullah wrote: > >> I'm pretty sure the array controller is observing >> NSManagedObjectContextObjectsDidChangeNotification to arrange its objects. >> Normally,

Re: urlFromString creating bad URLs with string containing []

2011-10-14 Thread Mike Abdullah
ment I'm using [NSData +dataWithContentsOfURL] running in its own > GCD dispatch queue. How much better performance should I expect to get using > NSURLConnection ? > > I'll need to weigh up the benefits before I go refactoring the server code. > > Cheers. > &

Re: NSArrayController Update Delay

2011-10-13 Thread Mike Abdullah
On 13 Oct 2011, at 21:20, Richard Somers wrote: > Consider a NSArrayController in entity mode. When a managed object is > inserted into the managed object context the controller's arrangedObjects > property is not updated immediately. > > Calling a controller 'fetch:' immediately after inserti

Re: urlFromString creating bad URLs with string containing []

2011-10-07 Thread Mike Abdullah
On 7 Oct 2011, at 12:45, Martin Linklater wrote: > Hi - I'm writing an iOS client for an online retailer and I'm having trouble > with the way NSURL encodes square brackets. I'm building an http request > using a string then converting it to a NSURL before calling [NSData > dataWithContentsOfU

Re: adding something to a setter

2011-10-06 Thread Mike Abdullah
On 6 Oct 2011, at 15:23, Stephan Michels wrote: > > Am 06.10.2011 um 15:54 schrieb Torsten Curdt: > >> Well, if the model is more complex and you bind the view to the model >> you can of course trigger the re-display on the observed changes. But >> what about a simple title property of e.g. a N

Re: adding something to a setter

2011-10-06 Thread Mike Abdullah
On 6 Oct 2011, at 13:09, Thomas Davie wrote: > I don't know of any better way than simply writing the setters yourself. One > thing I'd love to see apple add to the language is allowing us to specify a > code block to be included in setter and getting in the synthesize: > > @property (readwri

Re: Error Recovery at close of document window

2011-09-22 Thread Mike Abdullah
On 22 Sep 2011, at 14:06, Gerriet M. Denkmann wrote: > In a document based app, when > - (id)fileWrapperOfType:(NSString *)typeName error:(NSError **)outError > > does not work, I return an NSError with NSRecoveryAttempterErrorKey etc. > which gives the user the option to sort out the problem

Re: How to replace occurrences of a pattern with a NSAttributedString

2011-09-20 Thread Mike Abdullah
t 10:30, Sandeep Mohan Bhandarkar wrote: > Hi Mike, > > <> is a character sequence.. > > Thanks, > Sandeep > On Sep 20, 2011, at 2:26 AM, Mike Abdullah wrote: > >> >> On 20 Sep 2011, at 10:16, Sandeep Mohan Bhandarkar wrote: >> >>> Hi Al

Re: Duplicating an edited document in 10.7.1

2011-09-20 Thread Mike Abdullah
On 20 Sep 2011, at 10:49, Gerriet M. Denkmann wrote: > In my toy editor I open an existing document, modify it and click "Duplicate". > > A Sheet comes down and tells me that the duplicate will contain my latest > modifications. > I click the default "Duplicate" button and get: > > 2011-09-20

Re: NSDocument - based application and "--Edited" string in window title

2011-09-20 Thread Mike Abdullah
Sounds to me like you probably want to opt out of the new autosave-in-place behaviour. On 20 Sep 2011, at 10:55, Nick wrote: > Hello > Is there a way to get rid of this substring when the opened document is > changed? I would like to preserve the changes made until the user presses > Command+S (

Re: Find panel problems

2011-09-20 Thread Mike Abdullah
On 20 Sep 2011, at 08:54, jonat...@mugginsoft.com wrote: > > > On 20 Sep 2011, at 02:12, Ryan Joseph wrote: > >> Maybe I'm not understanding how the system works (where are the find panel >> docs anyways?) but I simply have an NSTextView with setUsesFindPanel enabled >> and when I open the f

Re: How to replace occurrences of a pattern with a NSAttributedString

2011-09-20 Thread Mike Abdullah
On 20 Sep 2011, at 10:16, Sandeep Mohan Bhandarkar wrote: > Hi All, > > > Can anyone tell me how the following can be achieved. I have a string as > given bellow. > > "This is a simple text with an attachment <>" > > I would like to replace the occurrence of the pattern "<>" with a > NSAtt

Re: NSURLConnection problem on Mac OS X 10.7

2011-09-08 Thread Mike Abdullah
On 7 Sep 2011, at 14:37, Payal Mundhada wrote: > Hi Mike, > > I am creating request as follows: > > @implementation WebService > -(void)makeRequest > { > m_URLRequest= [NSMutableURLRequest requestWithURL:url]; > [m_URLRequest setHTTPMethod:@"POST"]; >

Re: NSURLConnection problem on Mac OS X 10.7

2011-09-08 Thread Mike Abdullah
On 8 Sep 2011, at 14:30, Payal Mundhada wrote: > Hi, > I am calling this function in a thread using NSThread method from Main > thread (Handling UI) > > [NSThread detachNewThreadSelector:@selector(startDownload) toTarget:self > withObject:nil]; > > -(void)startDownload > {[myWebService mak

Re: NSURLConnection problem on Mac OS X 10.7

2011-09-07 Thread Mike Abdullah
Show us some code. On 2 Sep 2011, at 14:27, Payal Mundhada wrote: > > Hi All, > > I am making a web service call with NSURLConnection. > > Response is received correctly on Mac OS X 10.5 and Mac OS X 10.6. > > On Mac OS X 10.7, I am getting response as "Bad Request" for the same > request.

Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?

2011-09-06 Thread Mike Abdullah
On 6 Sep 2011, at 12:10, Vyacheslav Karamov wrote: > Cast window to the type id: > > if ([window respondsToSelector:@selector(setRestorationClass:)]) > { > [(id)window setRestorationClass:someClass]; > } That will only quieten the warning if -setRestorationClass: has been declared for some oth

Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?

2011-09-06 Thread Mike Abdullah
You're supposed to in such circumstances set your Deployment Target to 10.6, but SDK to 10.7. That will allow you to use new methods without warnings, but ship on 10.6. performSelector really isn't cumbersome at all: [window performSelector:@selector(setRestorationClass:) withObject:someClass];

Re: Saving PNG files from NSImage

2011-08-29 Thread Mike Abdullah
This code is making the assumption that [reps objectAtIndex:0] is a bitmap image rep. NSImage makes no such guarantees. Points: - Walk through all the image reps, looking for the best bitmap - If no bitmap exists, you'll have to create one by drawing the image into a bitmap context - If you're w

Re: Removing the Versions Button

2011-08-28 Thread Mike Abdullah
If you could tell us why you want to do this, that would help somewhat. On 28 Aug 2011, at 15:23, John Brayton wrote: > Hi, > > I have a document-based app that supports Versions. I am trying to > remove the Versions menu (with "Lock", "Duplicate", "Revert to the > Last Opened Version", and "Br

Re: Persistant reference to file that is not a path?

2011-08-26 Thread Mike Abdullah
NDAlias and BDAlias are the two candidates that come to mind Sent from my iPad On 26 Aug 2011, at 07:41 AM, Jens Alfke wrote: > > On Aug 25, 2011, at 9:18 PM, Joar Wingfors wrote: > >> Prior to Mac OS X 10.6 you can use "aliases", which have been around since >> before Mac OS X: >> >> >

Re: Catching actions of fonts "Typography" panel

2011-08-24 Thread Mike Abdullah
NSTextView has plenty of other delegate methods that will tell you why a change is about to happen. Use those to decide how to handle after the change has occurred. Sent from my iPad On 24 Aug 2011, at 11:39 AM, "Rimas M." wrote: > Hello folks, > > I am wondering - how it is possible to catc

Re: Crash using NSOpenPanel TFSVolumeInfo::GetSyncGCDQueue

2011-08-22 Thread Mike Abdullah
We've seen a few similar crashes in our non-GC app too. Sent from my iPad On 22 Aug 2011, at 09:30 AM, "jonat...@mugginsoft.com" wrote: > From time to time I experience the following crash when displaying > NSOpenPanel on Lion in a GC app. > It has prior form according to > http://www.cocoab

Re: Very different Document Saving in Lion, even without enabling asynchronous

2011-08-21 Thread Mike Abdullah
d On 21 Aug 2011, at 06:46 AM, Jerry Krinock wrote: > > On 2011 Aug 17, at 16:30, Mike Abdullah wrote: > >> Seeing as you knew it called an asynchronous method internally, you must >> have known that it might potentially return before saving is finished. > > Thank

Re: Looking for sample code to support NSRect resize in a view

2011-08-19 Thread Mike Abdullah
There's nothing built into cocoa for this. I wrote KSSelectionBorder to implement a decent chunk of the functionality: https://github.com/karelia/KSSelectionBorder Sent from my iPad On 19 Aug 2011, at 07:00 PM, Jeff Schriebman wrote: > Hello, > In a new project I am developing in Lion I disp

Re: Very different Document Saving in Lion, even without enabling asynchronous

2011-08-17 Thread Mike Abdullah
On 17 Aug 2011, at 23:18, Jerry Krinock wrote: > Although it's not mentioned in the 10.7 AppKit Release Notes, the various > methods involving document saving are invoked sequentially in 10.7, rather > than nested as they have always been, even if you have *not* enabled the new > asynchronous

Re: Exact behavior of NSLiteralSearch in string compare?

2011-08-16 Thread Mike Abdullah
I'm pretty sure that's what NSLiteralSearch does. In practice for me, I found the difference is that composed/decomposed character sequences are scene as being the same when using compare with no options, but that there's a difference when using NSLiteralSearch (and by extension, -isEqualToStrin

Re: How disable File/Open command -- SOLVED

2011-08-15 Thread Mike Abdullah
On 15 Aug 2011, at 14:52, McLaughlin, Michael P. wrote: > I managed to find this solution shortly after sending a request to this list > for help. I show the code below so that future programmers might find this > more easily that I did. This solution has not been tested with Lion. [Note: >

Re: Saving a rotated image

2011-08-10 Thread Mike Abdullah
Break the problem up. Which bits don't you know how to do? On 10 Aug 2011, at 07:37, charisse napeÿf1as wrote: > Hello All, > > Anybody knows how to save a rotated image to the Documents folder in iphone? > Given a variable number of degrees, how to save that rotated image in file, > keepin

Re: Frameworks (ConnectionKit)

2011-08-09 Thread Mike Abdullah
On 9 Aug 2011, at 21:36, Leo wrote: > You can use libcurl: > > http://curl.haxx.se/ > > Extremely powerful library, which is a part of Mac OS X, that supports most > protocols (FTP, SFTP, HTTP etc.) I find it very easy to use - but I've been > using it for years in either its command line (c

Re: Frameworks (ConnectionKit)

2011-08-09 Thread Mike Abdullah
Amy Gibbs wrote: > It seemed the easiest way of uploading a file to the server? > > > > Regards > > Willow Tree Crafts > Www.willowtreecrafts.co.uk > > On 9 Aug 2011, at 13:46, Mike Abdullah wrote: > >> Why have you picked FTP? >> >> On 9 Au

Re: Know when text is edited in any app

2011-08-09 Thread Mike Abdullah
w's delegate methods > specifically > 'textView:didCheckTextInRange:types:options:results:orthography:wordCount:' > to find out when auto-complete occurs. > > Whether or not this next step is possible, I am not sure. > > Josh > On Tuesday, 9 August 2011 at 13:40, Mi

Re: Frameworks (ConnectionKit)

2011-08-09 Thread Mike Abdullah
Why have you picked FTP? On 9 Aug 2011, at 12:04, Amy Heavey wrote: > Hi, > > I'd like to be able to use my mac app to upload an image to a server. From > googling it seems the best way to achieve this is using the ConnectionKit > framework to upload it via FTP. > > I've downloaded the frame

Re: NSCoding to/from JSON?

2011-08-09 Thread Mike Abdullah
I toyed with doing something very similar for plists that might be of interest: https://github.com/mikeabdullah/KSPropertyListEncoder On 8 Aug 2011, at 17:56, Jens Alfke wrote: > Been thinking about archiving NSObjects to/from JSON, using an API similar to > NSCoding. I haven’t found any prior

Re: Know when text is edited in any app

2011-08-09 Thread Mike Abdullah
Forget any notion of doing this for NSTextView I'd advise; Safari and Mail are based around WebViews. On 8 Aug 2011, at 19:47, Joshua Garnham wrote: > > I need to know when text is entered (or anything relating to a delegate > method happens) in any NSTextView in the active app whether it's my

Re: view:(QTMovieView *)view willDisplayImage:

2011-08-04 Thread Mike Abdullah
Have you tried putting both the movie view, and a custom overlay inside of a layer-backed view? The more traditional route I think is to add a child window for the overlay, keeping its size/placement in sync with the parent window Sent from my iPad On 4 Aug 2011, at 08:13 PM, julius wrote: >

Re: Deprecated methods usage

2011-08-03 Thread Mike Abdullah
Yes, you have to use it if you want your app to run on 10.4. For extra points, check at runtime if the newer method is available, and use that instead. On 3 Aug 2011, at 08:16, Vyacheslav Karamov wrote: > Hi All! > > Could I use deprecated methods in my application? > I have to support OS X 10

Re: Multithreaded Coredata save in Lion

2011-07-31 Thread Mike Abdullah
On 31 Jul 2011, at 16:58, Jim Thomason wrote: > Gang, > > I've encountered an odd bug/issue/feature(?) in Lion and want to know > if there's a workaround available. > > I have a multithreaded CoreData application. It does a lot of > calculations on the context, so it spawns off a separate threa

Re: Filter an array

2011-07-28 Thread Mike Abdullah
Further to earlier answers, bear in mind you've got no guarantee that file extensions are correct, or even exist. Plus of course, you might have both .jpg and .jpeg. You might well be better iterating through, finding the UTI of each file, and working from that. On 28 Jul 2011, at 21:35, Chris

Re: Fastest high-quality thumbnail display

2011-07-26 Thread Mike Abdullah
On 26 Jul 2011, at 01:55, James Merkel wrote: > Well, I see I have a huge memory leak in CIImage. > However, I don't see where my code is in error. > Also, according to Instruments Object Allocation, ImageIO is holding this > memory. > So I guess Core Image calls IImageIO. Yes, since ImageIO's

Re: Fastest high-quality thumbnail display

2011-07-25 Thread Mike Abdullah
On 25 Jul 2011, at 20:04, James Merkel wrote: > What is the fastest way to generate and display a thumbnail from a digital > camera file? > In the past I used NSImage -- however the quality (with JPEG files) leaves > something to be desired. Now I am using CIImage with Lanczos scale transform

Re: Xcode 3.2.6 on Lion ?

2011-07-23 Thread Mike Abdullah
Ah, I guess we had the opposite case. Were building against 10.5 SDK and that wouldn't run on Lion seeds. Runs on Lion GM though Sent from my iPad On 23 Jul 2011, at 10:28 PM, Jean-Daniel Dupas wrote: > > Le 23 juil. 2011 à 23:22, Mike Abdullah a écrit : > >>> Oh,

Re: Xcode 3.2.6 on Lion ?

2011-07-23 Thread Mike Abdullah
> Oh, then there's 10.5 thing with libcrypto As far as I can tell that got fixed for the GM. ___ 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-de

Re: NSArrayController nib binding vs code binding

2011-07-19 Thread Mike Abdullah
On 19 Jul 2011, at 02:41, Trygve Inda wrote: >> [myArrayController bind:@"content" toObject:myClassObject >> withKeyPath:@"places" options:NULL]; > > Hmm... Seems like it should be bind:@"contentArray" Please use the NSContentArrayBinding constant as that's what's it exists for, despite being

<    1   2   3   4   5   6   7   8   9   10   >