copy in WebView

2012-10-11 Thread Gerriet M. Denkmann
I have a WebView which displays text which contains some invisible characters (like ZERO WIDTH SPACE). When I use Edit→Copy these characters are also put on the pasteboard. But this does not make sense. The pasteboard should contain the selected text without these invisible characters. How to d

copy in WebView

2012-10-11 Thread Gerriet M. Denkmann
I have a WebView which displays text which contains some invisible characters (like ZERO WIDTH SPACE). When I use Edit→Copy these characters are also put on the pasteboard. But this does not make sense. The pasteboard should contain the selected text without these invisible characters. How to d

Re: copy in WebView

2012-10-11 Thread Gerriet M. Denkmann
On 12 Oct 2012, at 00:11, Kyle Sluder wrote: > On Oct 11, 2012, at 10:00 AM, "Gerriet M. Denkmann" > wrote: > >> >> On 11 Oct 2012, at 23:45, Kyle Sluder wrote: >> >>> On Oct 11, 2012, at 8:26 AM, "Gerriet M. Denkmann" >>

Re: copy in WebView

2012-10-12 Thread Gerriet M. Denkmann
On 12 Oct 2012, at 00:19, "Gerriet M. Denkmann" wrote: > > On 12 Oct 2012, at 00:11, Kyle Sluder wrote: > >> On Oct 11, 2012, at 10:00 AM, "Gerriet M. Denkmann" >> wrote: >> >>> >>> On 11 Oct 2012, at 23:45, Kyle Sluder w

Re: copy in WebView

2012-10-13 Thread Gerriet M. Denkmann
On 12 Oct 2012, at 23:02, Kyle Sluder wrote: > On Oct 12, 2012, at 1:47 AM, "Gerriet M. Denkmann" > wrote: > >> >> I managed (using: ) to get the >> selection and modify it (removing unwanted characters) but I do not know how >> to put the res

Re: copy in WebView

2012-10-13 Thread Gerriet M. Denkmann
On 13 Oct 2012, at 21:30, Keary Suska wrote: > On Oct 13, 2012, at 5:12 AM, Gerriet M. Denkmann wrote: > >> >> On 12 Oct 2012, at 23:02, Kyle Sluder wrote: >> >>> On Oct 12, 2012, at 1:47 AM, "Gerriet M. Denkmann" >>> wrote: >>&g

Re: copy in WebView

2012-10-13 Thread Gerriet M. Denkmann
On 14 Oct 2012, at 01:46, Kyle Sluder wrote: > On Sat, Oct 13, 2012, at 09:47 AM, Gerriet M. Denkmann wrote: >> Well, there is one small problem: >> This line: >> if ( [ targetForCopy isKindOfClass: NSClassFromString (@"WebHTMLView") >> ] )

Re: copy in WebView

2012-10-14 Thread Gerriet M. Denkmann
On 14 Oct 2012, at 03:26, Kyle Sluder wrote: > On Sat, Oct 13, 2012, at 01:19 PM, Andy Lee wrote: >> Unless I'm mistaken, Kyle meant the view hierarchy, not the inheritance >> hierarchy. In other words, if you go up the superview chain starting at >> the window's first responder, do you encounte

Re: copy in WebView

2012-10-14 Thread Gerriet M. Denkmann
On 14 Oct 2012, at 16:07, Heinrich Giesen wrote: > > On 13.10.2012, at 21:00, Kyle Sluder wrote: > >> Could you instead broaden your test to "my WebView or any of its >> descendants is first responder?" > > or simply use directly the WebView on the responderchain. Because I had > similar pr

Binding InfoPanel to currentDocument

2012-10-25 Thread Gerriet M. Denkmann
I have a Panel which has a PopUpButton which has it's Content Values bound to an ArrayController. The ArrayController has it's Content Array bound to File's Owner: currentDocument.listOfThings. The File's Owner (aka) Application Delegate: @property (readonly) DocumentSubclass *currentDocument;

Re: Binding InfoPanel to currentDocument

2012-10-26 Thread Gerriet M. Denkmann
On 26 Oct 2012, at 01:11, Seth Willits wrote: > On Oct 25, 2012, at 4:36 AM, Gerriet M. Denkmann wrote: > >> This works, but I have a strong feeling that there is a very obvious better >> solution which I somehow cannot see. > > > There actually isn't a

Saving with Encoding

2012-10-26 Thread Gerriet M. Denkmann
My NSDocument subclass overrides fileAttributesToWriteToURL:ofType:forSaveOperation:originalContentsURL:error: and returns: CharacterEncoding = 2147484701; ← Thai (Windows, DOS) DocumentType = NSPlainText; UTI = "public.plain-text"; When I open the file again I get in readFromURL:of

Re: Binding InfoPanel to currentDocument

2012-10-26 Thread Gerriet M. Denkmann
On 26 Oct 2012, at 16:11, Kyle Sluder wrote: > On Oct 26, 2012, at 1:52 AM, "Gerriet M. Denkmann" > wrote: > >> >> On 26 Oct 2012, at 01:11, Seth Willits wrote: >> >>> On Oct 25, 2012, at 4:36 AM, Gerriet M. Denkmann wrote: >>> >&

printing Utf8

2012-10-31 Thread Gerriet M. Denkmann
I print strings like: NSString *s = @"ร่วมรส"; fprintf(stderr, "%s\n", [ s UTF8String]); and usually it just works. But sometimes it does not and I get garbage like: ร่ว\340\270\241รส Converting these numbers to hex one gets: 0xe0 0xb8 0xa1 which is the Utf8-code for THAI CHARACT

Re: printing Utf8

2012-10-31 Thread Gerriet M. Denkmann
On 31 Oct 2012, at 22:15, Ken Thomases wrote: > On Oct 31, 2012, at 9:41 AM, Gerriet M. Denkmann wrote: > >> I print strings like: >> NSString *s = @"ร่วมรส"; >> fprintf(stderr, "%s\n", [ s UTF8String]); >> and usually it just works.

Re: printing Utf8

2012-10-31 Thread Gerriet M. Denkmann
On 31 Oct 2012, at 22:15, Ken Thomases wrote: > On Oct 31, 2012, at 9:41 AM, Gerriet M. Denkmann wrote: > >> I print strings like: >> NSString *s = @"ร่วมรส"; >> fprintf(stderr, "%s\n", [ s UTF8String]); >> and usually it just works.

WebPolicyDelegate declared where?

2012-11-01 Thread Gerriet M. Denkmann
My app delegate (Mac OS X) looks like this: #import @interface MyAppDelegate : NSObject But Xcode (4.5.1) complains: Cannot find protocol declarations for "WebPolicyDelegate". What am I doing wrong? Gerriet. ___ Cocoa-dev mailing list (Cocoa-

printing arrays

2012-11-02 Thread Gerriet M. Denkmann
This code: NSString *key = @"กุญแจ"; NSString *value = @"คุณค่า"; NSArray *array = @[ key, value ]; NSLog(@" Two nice strings: %@ %@", key, value); NSLog(@" Bad Array: %@", array); prints: 2012-...] Two nice strings: กุญแจ คุณค่า 2012-...] Bad Array: ( "\U0e01\U0e38\U0e0d\U0e41\U0e08",

Re: printing arrays

2012-11-02 Thread Gerriet M. Denkmann
On 3 Nov 2012, at 00:35, Kyle Sluder wrote: > On Fri, Nov 2, 2012, at 10:02 AM, Gerriet M. Denkmann wrote: >> This code: >> >> NSString *key = @"กุญแจ"; >> NSString *value = @"คุณค่า"; >> NSArray *array = @[ key, value ]; >> NSLog(@&qu

Re: printing arrays

2012-11-03 Thread Gerriet M. Denkmann
On 3 Nov 2012, at 12:47, Quincey Morris wrote: > On Nov 2, 2012, at 22:18 , "Gerriet M. Denkmann" wrote: > >> Is there a way to make the first NSLog work? >> I seem to remember that it calls something like debuggingDescription, which, >> if not overridden c

Re: printing arrays

2012-11-03 Thread Gerriet M. Denkmann
On 3 Nov 2012, at 22:42, Kyle Sluder wrote: > On Nov 2, 2012, at 10:18 PM, "Gerriet M. Denkmann" > wrote: > >> >> On 3 Nov 2012, at 00:35, Kyle Sluder wrote: >> >>> If this is just for debugging purposes, you could swizzle -[NSArray &

Re: printing arrays

2012-11-08 Thread Gerriet M. Denkmann
On 3 Nov 2012, at 22:42, Kyle Sluder wrote: > On Nov 2, 2012, at 10:18 PM, "Gerriet M. Denkmann" > wrote: > >> >> On 3 Nov 2012, at 00:35, Kyle Sluder wrote: >> >>> If this is just for debugging purposes, you could swizzle -[NSArray &

How to implement readonly property

2012-11-12 Thread Gerriet M. Denkmann
I have a property: @property (readonly) NSDictionary *someDictionary; This property should be computed on demand, and should be accessible by several threads. My current implementation is: - (NSDictionary *)someDictionary; { static NSDictionary *someDictionary; st

What about QLSeamlessDocumentOpener

2012-11-25 Thread Gerriet M. Denkmann
What does this mean? What can I do to get rid of these warnings? [QL] QLError(): -[QLSeamlessDocumentOpener showWindow:contentFrame:withBlock:] should only be called in the main thread CoreAnimation: warning, deleted thread with uncommitted CATransaction; created by: 0 QuartzCore

Re: What about QLSeamlessDocumentOpener

2012-11-25 Thread Gerriet M. Denkmann
On 25 Nov 2012, at 19:21, Graham Cox wrote: > > On 25/11/2012, at 10:21 PM, "Gerriet M. Denkmann" > wrote: > >> What does this mean? What can I do to get rid of these warnings? > > Short answer: don't call -openUntitledDocument... on a thread other

Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
My app creates lots of MyOperations (subclass of NSOperation) and puts them into an NSOperationQueue. I would expect that the app thus remains responsive, but sometimes it is not. A sure way to beach-ball my app is: start it with a few hundred operations (which will take about 20 seconds to fin

Re: Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
ng takes place. What magic do I have to perform to make Instruments (4.5) work? (I asked this on the Xcode list already, but got no answer). > > On 4 Dec 2012, at 10:29, "Gerriet M. Denkmann" wrote: > >> My app creates lots of MyOperations (subclass of NSOperation) a

Re: Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
his means. Maybe someone can enlighten me. Gerriet. > > On 4 Dec, 2012, at 7:02 PM, "Gerriet M. Denkmann" > wrote: > >> >> On 4 Dec 2012, at 17:49, Mike Abdullah wrote: >> >>> You have a performance problem. Thus you should use Instruments to

Re: Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
On 4 Dec 2012, at 18:31, "jonat...@mugginsoft.com" wrote: > > > On 4 Dec 2012, at 10:29, Gerriet M. Denkmann wrote: > >> My app creates lots of MyOperations (subclass of NSOperation) and puts them >> into an NSOperationQueue. >> >> I wou

Beachballing 2

2012-12-04 Thread Gerriet M. Denkmann
My app creates lots of MyOperations (subclass of NSOperation) and puts them into an NSOperationQueue. These operations do not do any I/O - they just use the Cpu. When I make some other app active and then try again to make my app active, my app beach-balls. When all my operations have finished,

NSOperation Efficiency

2012-12-04 Thread Gerriet M. Denkmann
I have an app which uses NSOperations inside an NSOperationQueue. These operations do not do any I/O - just Cpu. No swapping is taking place. When I set [ self.operationQueue setMaxConcurrentOperationCount: 1 ] each operation takes on average 200 msec., measured by NSDate. With 2 concurrent ope

Re: Beachballing 2

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 01:33, Jens Alfke wrote: > > On Dec 4, 2012, at 9:54 AM, Gerriet M. Denkmann wrote: > >> My app creates lots of MyOperations (subclass of NSOperation) and puts them >> into an NSOperationQueue. >> These operations do not do any I/O - they just us

Re: NSOperation Efficiency

2012-12-04 Thread Gerriet M. Denkmann
es my app unresponsive (i.e unusable) until all operations have finished. Triggered by making other app, active, then again my app. > > On 4 Dec 2012, at 18:15, "Gerriet M. Denkmann" wrote: > >> I have an app which uses NSOperations inside an NSOperationQueue. These >

Re: NSOperation Efficiency

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 02:58, Kyle Sluder wrote: > On Tue, Dec 4, 2012, at 10:15 AM, Gerriet M. Denkmann wrote: >> I have an app which uses NSOperations inside an NSOperationQueue. These >> operations do not do any I/O - just Cpu. No swapping is taking place. >> >> When

Arc and **

2012-12-04 Thread Gerriet M. Denkmann
I have (using Arc) a method which works fine: NSString *explanation; [ self doSomeThingAndExplain: &explanation ]; Now I decided that sometimes I don't need this explanation. So I changed it to: NSString **explanatioP = urgent ? NULL : &explanation; // <-- "no explicit ownership... [ self doSome

Re: Arc and **

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 12:59, Greg Parker wrote: > On Dec 4, 2012, at 8:56 PM, Gerriet M. Denkmann wrote: >> I have (using Arc) a method which works fine: >> NSString *explanation; >> [ self doSomeThingAndExplain: &explanation ]; >> >> Now I decided that someti

Re: NSOperation Efficiency

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 11:41, Kyle Sluder wrote: > > On Dec 4, 2012, at 8:00 PM, Jens Alfke wrote: > >> >> On Dec 4, 2012, at 7:33 PM, Kyle Sluder wrote: >> >>> Yeah, it sounds like you're saturating the thread pool due to >>> non-CPU-bound operations. NSOpQ is going to spend its entire tim

Re: Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 01:29, Jens Alfke wrote: > > On Dec 4, 2012, at 3:48 AM, Gerriet M. Denkmann wrote: > >> My app creates lots of MyOperations (subclass of NSOperation) and puts them >> into an NSOperationQueue. >> I would expect that the app thus remains responsi

Re: NSOperation Efficiency

2012-12-05 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 15:07, Quincey Morris wrote: > On Dec 4, 2012, at 23:02 , "Gerriet M. Denkmann" wrote: > >> And got almost the same overhead (tested three times with 99 operations); >> clock time per operationexpected time overhead factor >

Re: Operations Beachball

2012-12-05 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 15:57, Joar Wingfors wrote: > What happens if you remove the "isCancelled" checks? No effect on blocking. > How do you create your operation queue? if ( self.operationQueue == nil ) { self.operationQueue = [ [ NSOperati

Re: NSOperation Efficiency

2012-12-06 Thread Gerriet M. Denkmann
On 6 Dec 2012, at 05:33, Graham Cox wrote: > > On 05/12/2012, at 8:09 PM, Gerriet M. Denkmann wrote: > >> for( NSUInteger i = 0; i < self.nbrWork; i++ ) >> { >> GmdOperationBasis *m2 = [ [ GmdOperationBasis alloc ] init ]; >>

iOS: failed to attach drawable storage

2012-12-12 Thread Gerriet M. Denkmann
An iOS app which compiled and build and run in May (probably iOS 5) now creates the following messages when running in iPhone or iPad Simulator Version 6.0 (358.4): -[AppDelegate application:didFinishLaunchingWithOptions:] start -[MapViewController viewDidLoad] start -[MapViewCon

Re: iOS: failed to attach drawable storage

2012-12-12 Thread Gerriet M. Denkmann
On 12 Dec 2012, at 20:51, "Gerriet M. Denkmann" wrote: > An iOS app which compiled and build and run in May (probably iOS 5) now > creates the following messages when running in iPhone or iPad Simulator > Version 6.0 (358.4): > > -[AppDelegate application:didF

How to get used UIFont

2012-12-27 Thread Gerriet M. Denkmann
I want to know which fonts can be used for a given character. On OS X I would iterate over all fonts using coveredCharacterSet and then longCharacterIsMember:. But on iOS there seems to be no coveredCharacterSet. So I tried an attributedString which contains my character, asking it for the NSFon

Re: faster deep copies?

2013-02-14 Thread Gerriet M. Denkmann
On 15 Feb 2013, at 01:25, Ken Thomases wrote: > > > On Feb 14, 2013, at 8:30 AM, Uli Kusterer wrote: > >> On Feb 14, 2013, at 3:57 AM, Ken Thomases wrote: >>> Your question prompted me to try to design an analog of NSKeyedArchiver, >>> NSCode, and NSCoding that would generate the new objec

lengthOfBytesUsingEncoding not correct

2013-02-15 Thread Gerriet M. Denkmann
This program: NSString *s = @"หัวหิน"; NSUInteger l3 = [ s lengthOfBytesUsingEncoding: NSUTF16StringEncoding ]; NSLog(@"%s NSUTF16StringEncoding length %lu", __FUNCTION__, l3); NSData *d9 = [ s dataUsingEncoding: NSUTF16StringEncoding ]; N

Multiple methods named...

2013-02-16 Thread Gerriet M. Denkmann
ClassA has a method: -(RootA *)rootObject; ClassB has a method: -(RootB *)rootObject; id someObject; if ( something ) { someObject = instance of ClassA; } else { someObject = instance of ClassB; } id someRoot = [ someObject rootObject ]; Here the compiler complains: "Multiple

How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
I am trying to build my own version of NSKeyed(Un)Archiver. But I do not know how to recognise mutability. 1. use isKindOfClass: [NSMutableString class] disadvantage: all strings turn out to be mutable 2. use respondsToSelector: @selector(appendString:) disadvantage: all strings

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 00:42, Markus Spoettl wrote: > On 2/20/13 9:10 AM, Gerriet M. Denkmann wrote: >> P.S. >> I want my own archiver for 2 reasons: >> 1. NSKeyedArchiver can store only certain strings > > I find that very hard to believe. I find that very easy to

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 11:27, Jens Alfke wrote: > > On Feb 20, 2013, at 8:05 PM, "Gerriet M. Denkmann" > wrote: > >> I find that very easy to proof: > > Looks like you’re right — it’s the string @“$null” that’s to blame, for some > reason. I would guess t

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 11:15, Jens Alfke wrote: > > On Feb 20, 2013, at 12:10 AM, Gerriet M. Denkmann > wrote: > >> But I do not know how to recognise mutability. >> >> 1. use isKindOfClass: [NSMutableString class] >> disadvantage: all strings turn out

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 12:09, Jens Alfke wrote: > > On Feb 20, 2013, at 8:39 PM, Gerriet M. Denkmann wrote: > >> They are using $null to stand for nil. Which does not play nice with >> NSArrays (and other containers), which cannot contain nil. > > Plus, the object @“

Re: How to recognize mutability?

2013-02-20 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 12:58, Jens Alfke wrote: > > On Feb 20, 2013, at 9:31 PM, Gerriet M. Denkmann wrote: > >> But another bug looks rather promising: feed strings with illegal Unicode to >> NSArchiver and see what happens. > > It’s harder to get such a string int

Re: How to recognize mutability?

2013-02-21 Thread Gerriet M. Denkmann
On 21 Feb 2013, at 17:08, Kyle Sluder wrote: > On Feb 20, 2013, at 10:38 PM, "Gerriet M. Denkmann" > wrote: > >> >> Looks like there is an exception, though nothing gets logged in the Xcode >> console: >> >> frame #0: 0x7fff88d483c5 l

Re: How to recognize mutability?

2013-02-21 Thread Gerriet M. Denkmann
On 22 Feb 2013, at 03:00, Markus Spoettl wrote: > > > On 2/21/13 5:05 AM, Gerriet M. Denkmann wrote: >>> On 2/20/13 9:10 AM, Gerriet M. Denkmann wrote: >>>> P.S. >>>> I want my own archiver for 2 reasons: >>>> 1. NSKeyedArchiver can store

archiving report

2013-02-26 Thread Gerriet M. Denkmann
My investigations regarding archiving on OS X: 1. NSArchiver stores all strings in Utf-8. This is inefficient for strings which contain mainly non-european characters (e.g. Chinese or Thai) as one character will use 3 bytes (Utf-16 would use only 2). Corollary: It cannot store st

Re: archiving report

2013-02-26 Thread Gerriet M. Denkmann
On 27 Feb 2013, at 01:00, Gwynne Raskind wrote: > On Feb 26, 2013, at 12:47 PM, Gerriet M. Denkmann > wrote: >> My investigations regarding archiving on OS X: >> >> 1. NSArchiver stores all strings in Utf-8. >> This is inefficient for strings whi

Re: archiving report

2013-02-26 Thread Gerriet M. Denkmann
On 27 Feb 2013, at 01:04, Kyle Sluder wrote: > On Feb 26, 2013, at 9:47 AM, "Gerriet M. Denkmann" > wrote: > >> My investigations regarding archiving on OS X: >> >> 1. NSArchiver stores all strings in Utf-8. >> This is inefficient fo

Re: archiving report

2013-02-26 Thread Gerriet M. Denkmann
On 27 Feb 2013, at 07:20, Graham Cox wrote: > > On 27/02/2013, at 5:56 AM, Gerriet M. Denkmann wrote: > >> I have filed the $null bug. Got back as duplicate with a very low id-number. >> Meaning: this bug is known to Apple since several years. Still no fix. > >

Re: archiving report

2013-02-26 Thread Gerriet M. Denkmann
On 27 Feb 2013, at 02:17, Kyle Sluder wrote: > On Tue, Feb 26, 2013, at 11:06 AM, Gerriet M. Denkmann wrote: >> You can create and archive (with NSKeyedArchiver) illegal strings. >> unichar u = kUCHighSurrogateRangeStart; >> NSString *s = [ NSString stringWithCharacters: &a

Re: archiving report

2013-02-27 Thread Gerriet M. Denkmann
On 27 Feb 2013, at 02:17, Kyle Sluder wrote: > I understand the frustration caused by Apple's embarrassing penchant for not > fixing bugs. > But refusing to report future bugs is only going to harm yourself. Grudgingly I did: NSKeyedArchiver creates bloated archives. Your tracking number for

Re: archiving report

2013-02-27 Thread Gerriet M. Denkmann
On 28 Feb 2013, at 02:28, Tony Parker wrote: > On Feb 26, 2013, at 10:56 AM, Gerriet M. Denkmann > wrote: >> >> On 27 Feb 2013, at 01:00, Gwynne Raskind wrote: >> >>>> 2. NSKeyedArchiver seems to be ok. >>>>But it does creat

How to unarchive?

2013-02-27 Thread Gerriet M. Denkmann
Assume I do: ThingWhichKnowsItsContainer *a = [[ ThingWhichKnowsItsContainer alloc ] init]; NSArray *array = @[ a ]; a.theContainer = array; NSData *d = [ NSKeyedArchiver archivedDataWithRootObject: array]; NSArray *unarchivedArray = [ MyVeryOwnUnarchiver: unarchiveObjectWithData: d ]; MyVeryOwnU

Re: archiving report

2013-02-28 Thread Gerriet M. Denkmann
On 28 Feb 2013, at 14:41, Kyle Sluder wrote: > > All you have shown is that NSKeyedArchiver is not optimized for your > contrived use case. Whenever some object is used (referenced from some other object) n times there are n-1 unnecessary object references created. This might happen in real

Re: archiving report

2013-02-28 Thread Gerriet M. Denkmann
On 28 Feb 2013, at 14:41, Kyle Sluder wrote: > On Feb 27, 2013, at 10:46 PM, "Gerriet M. Denkmann" > wrote: > > . Where are your stats about serializing and de serializing real world > archives? For NIBs vs for the kind of object graphs that are sent over DO > c

Re: archiving report

2013-02-28 Thread Gerriet M. Denkmann
On 28 Feb 2013, at 21:52, Graham Cox wrote: > > On 01/03/2013, at 1:12 AM, "Gerriet M. Denkmann" wrote: > >> So nibs seem to be bloated by 7 ... 22 % > > > Serious question. Is it really worth obsessing about 22% of a few K in this > day and age? Pro

View Based Table - where is my data?

2013-05-01 Thread Gerriet M. Denkmann
A NSTableView with one column which uses NSTableCellViews. Uses DataSource: - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { NSDictionary *aLine = self.dataArray[rowIndex]; NSTableCellView *cellView = [ aTa

Re: View Based Table - where is my data?

2013-05-01 Thread Gerriet M. Denkmann
On 1 May 2013, at 23:51, Quincey Morris wrote: > On May 1, 2013, at 08:34 , "Gerriet M. Denkmann" wrote: > >> - (id)tableView:(NSTableView *)aTableView >> objectValueForTableColumn:(NSTableColumn *)aTableColumn >> row:(NSInteger)rowIndex >> { >

View Based TableView - how to use bindings?

2013-05-01 Thread Gerriet M. Denkmann
I have a view-based table view which currently uses a DataSource. But I would like to use bindings instead. I know how to do this with a cell-based table view - and I was following "Populating View-Based Table Views using Cocoa Bindings". My array controller has arrangedObjects which seem to be

Re: View Based TableView - how to use bindings?

2013-05-01 Thread Gerriet M. Denkmann
On 2 May 2013, at 02:16, Quincey Morris wrote: > On May 1, 2013, at 11:52 , "Gerriet M. Denkmann" wrote: > >> The Array Controller has it's content bound to some array of dictionaries, >> which have the keys "Name" and "Image". >

Re: View Based TableView - how to use bindings?

2013-05-01 Thread Gerriet M. Denkmann
On 2 May 2013, at 03:16, Quincey Morris wrote: I got it working. Formerly I had: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { self.dataArray = [ NSMutableArray array ]; // this is the content of my ArrayController for(...) { fill self.dataAr

Sorting a view based TableView with bindings

2013-05-02 Thread Gerriet M. Denkmann
I have a cell-based TableView which is filled via ArrayController using bindings. Sorting just works. Now I changed this to a view-based TableView and suddenly no more automatic sorting. It has just one column which uses an NSTableCellView. The Static Text has it's Value bound to Table Cell Vie

Re: Sorting a view based TableView with bindings

2013-05-02 Thread Gerriet M. Denkmann
On 2 May 2013, at 14:49, Quincey Morris wrote: > On May 2, 2013, at 00:31 , "Gerriet M. Denkmann" wrote: > >> When I click on the header nothing happens (except the current selection is >> set to none and the small triangle on the right side alternate between

Enable Unique Selection

2013-05-02 Thread Gerriet M. Denkmann
I have a button which only makes sense when exactly one thing is selected. Currently it's Enabled property is bound to Array Controller.selectedObjects.@count. I.e. the button is enabled if one or more things are selected. But I want it to be disabled when nothing is selected AND also if more tha

Re: Enable Unique Selection

2013-05-03 Thread Gerriet M. Denkmann
On 3 May 2013, at 17:07, Andy Lee wrote: > On May 3, 2013, at 1:29 AM, Gerriet M. Denkmann wrote: >> I have a button which only makes sense when exactly one thing is selected. >> Currently it's Enabled property is bound to Array >> Controller.selectedObjects.@co

scroll UITableView

2013-05-22 Thread Gerriet M. Denkmann
I have an UITableView with several searchOptions (like: "Starts with", "Ends with", etc.). When the user changes the search option, the UISearchDisplayDelegate implements: - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOp

Restricted FontPanel

2013-05-26 Thread Gerriet M. Denkmann
I want (on OS X 10.8.3) to show a font panel, which only has nice fonts (e.g. only fonts which are able to show "门"). There is a delegate method of NSFontManager: - (BOOL)fontManager:(id)theFontManager willIncludeFont:(NSString *)fontName Requests permission from the Font panel delegate to displa

Re: Restricted FontPanel

2013-05-26 Thread Gerriet M. Denkmann
versions 10.3 and later." >> If the delegate returns TRUE (or doesn’t implement this method), the font is >> added. If the delegate returns FALSE, the font isn’t added. This method must >> be invoked before the loading of the main nib file. > > Sent from my iPh

Re: Restricted FontPanel

2013-05-27 Thread Gerriet M. Denkmann
On 27 May 2013, at 17:26, Uli Kusterer wrote: > On 26.05.2013, at 13:48, Gerriet M. Denkmann wrote: >> I want (on OS X 10.8.3) to show a font panel, which only has nice fonts >> (e.g. only fonts which are able to show "门"). > > Have you tried whether you can

My App refuses to rotate

2013-05-28 Thread Gerriet M. Denkmann
I have an iOS 6.1 app. Info.plist contains: UIInterfaceOrientation UIInterfaceOrientationPortrait UISupportedInterfaceOrientations UIInterfaceOrientationLandscapeRight UIInterfaceOrientationLandscapeLeft UIInterface

Re: My App refuses to rotate

2013-05-28 Thread Gerriet M. Denkmann
rtrait. And it still did not rotate. Changed the order in UISupportedInterfaceOrientations to start with UIInterfaceOrientationPortrait. Now it is at least usable (but still does not rotate). > > On May 28, 2013, at 12:01 AM, Gerriet M. Denkmann > wrote: > >> I h

Re: My App refuses to rotate

2013-05-28 Thread Gerriet M. Denkmann
On 28 May 2013, at 14:14, Andreas Liebschner wrote: > On Tue, May 28, 2013 at 9:01 AM, Gerriet M. Denkmann > wrote: > >> But in the iPhone simulator and in the iPhone device the rootViewController >> always has interfaceOrientation = 1 (Portrait). >> All othe

how to cache images

2013-06-08 Thread Gerriet M. Denkmann
I have an app which displays gif images in an ImageView. NSString *path = @"/some/path/to/a.gif"; NSURL *url = [ [ NSURL alloc ] initWithScheme: @"http" host: @"www.some.host" path: path ]; NSImage *image = [ [ NSImage alloc ] initByReferencingURL: url ]; [ self.

Re: how to cache images

2013-06-08 Thread Gerriet M. Denkmann
On 9 Jun 2013, at 06:23, Jens Alfke wrote: > > On Jun 8, 2013, at 12:24 PM, Ken Thomases wrote: > >> I haven't done the experiment, but I don't believe this is necessarily true. >> NSBitmapImageRep is documented (in the Snow Leopard release notes) as >> keeping the original image data and

Re: how to cache images

2013-06-08 Thread Gerriet M. Denkmann
On 9 Jun 2013, at 08:57, Kyle Sluder wrote: > On Jun 8, 2013, at 5:39 PM, "Gerriet M. Denkmann" > wrote: > >> >> On 9 Jun 2013, at 06:23, Jens Alfke wrote: >> >>> >>> On Jun 8, 2013, at 12:24 PM, Ken Thomases wrote: >>>

NSURLConnection and 404

2013-06-09 Thread Gerriet M. Denkmann
This works fine, but blocks my for 1 sec on a good day - who know how long if the net is slow: url = something/which/might/exist/or/not.gif data = [ NSData dataWithContentsOfURL: url options: mask error: &outError ]; So I am trying to use NSURLConnection instead. Also works fine. Only: if my ur

Re: NSURLConnection and 404

2013-06-09 Thread Gerriet M. Denkmann
On 9 Jun 2013, at 16:54, Jean-Daniel Dupas wrote: > > Le 9 juin 2013 à 11:35, Gerriet M. Denkmann a écrit : > >> This works fine, but blocks my for 1 sec on a good day - who know how long >> if the net is slow: >> >> url = something/which/might/ex

NSLinguisticTagger usable for non-english?

2013-08-05 Thread Gerriet M. Denkmann
I am trying to use NSLinguisticTagger with German. Has anybody ever tried this and found it usable? E.g. "Ich motivier dich" ends with Verb, Pronoun (ok). But: "Ich motivier dich." ends with two Adjectives (wrong). And "motivier" is a Number, "motivier." is an Adjective (both wrong). What I am tr

Re: NSLinguisticTagger usable for non-english?

2013-08-05 Thread Gerriet M. Denkmann
Verb, Noun, etc. > Change the scheme to NSLinguisticTagSchemeLemma. Hope this helps. > > On Aug 5, 2013, at 1:18 PM, Gerriet M. Denkmann wrote: > >> I am trying to use NSLinguisticTagger with German. >> Has anybody ever tried this and found it usable? >> >> E.g

Crash on nib loading

2013-08-08 Thread Gerriet M. Denkmann
This used to work (10.7, but maybe later as well) but crashes today on 10.8.4: _graphicsInspectorController = [[NSWindowController alloc] initWithWindowNibName:@"Inspector"]; NSWindow *window = [_graphicsInspectorController window]; ← crashes here Looks like some NSTextFieldCell is kind of

Re: Crash on nib loading

2013-08-08 Thread Gerriet M. Denkmann
By deleting all textFields from my nib one by one I found out that some label (const string) had a binding. This certainly was not my intention. Don't know how this did happen. Were there any hints to this being the problem in the exception or back-trace? I didn't see any - but this proofs nothin

How to get rid of keyboard on iPhone

2013-08-13 Thread Gerriet M. Denkmann
I have an app with a textView on an iPad. When I touch it, a keyboard comes up. And when I have typed enough there is, in the bottom right corner of the keyboard, a key, which makes the keyboard disappear again. So far so good. But when the same app runs on an iPhone, the keyboard has no such ke

Visible range in UITextView

2013-08-14 Thread Gerriet M. Denkmann
I have a TextView which can be messed up via buttons (e.g. set a new font) but which should keep showing the same range. Like: - (void)applyNewFont: (UIFont *)f { NSRange visibleCharacterRange = self.textView.visibleRange; self.textView.font = f; [ self.textView scrollRa

Strange behaviour of NSLayoutManager

2013-08-14 Thread Gerriet M. Denkmann
The iPhone Simulator runs this code: - (IBAction)fontSizeSliderHasMoved: sender; { CGPoint contentOffset = self.textView.contentOffset;// we only use x-value, which is always zero NSTextContainer *textContainer = self.textView.textContainer; NSLayoutManager

predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
I have some code which is almost identical vor iOS and OS X. So I want to write something like: #ifdef SOME_THING // OS X NSRect someRect = ... #else // iOS CGRect someRect =... #endif But what to choose for SOME_THING? Gerriet. _

Re: predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
d it, and it works perfectly. Thank you very much! Is this documented anywhere? Xcode seems not to know about this. > On Aug 16, 2013, at 05:10 , Gerriet M. Denkmann wrote: > >> I have some code which is almost identical vor iOS and OS X. >> So I want to write some

Re: predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
On 16 Aug 2013, at 22:59, Kyle Sluder wrote: > On Aug 16, 2013, at 9:51 AM, "Gerriet M. Denkmann" > wrote: > >> >> On 16 Aug 2013, at 19:17, Rick Mann wrote: >> >>> One thing to note: in the 64-bit run time, NSRect and CGRect are the same

Re: predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
On 17 Aug 2013, at 01:33, Greg Parker wrote: > On Aug 16, 2013, at 5:10 AM, Gerriet M. Denkmann wrote: >> I have some code which is almost identical vor iOS and OS X. >> So I want to write something like: >> >> #ifdef SOME_THING >> // OS X >&

Re: predefined macro iOS vs OS X

2013-08-16 Thread Gerriet M. Denkmann
On 17 Aug 2013, at 00:04, Kyle Sluder wrote: > On Aug 16, 2013, at 12:41 PM, "Gerriet M. Denkmann" > wrote: > >> >> On 16 Aug 2013, at 22:59, Kyle Sluder wrote: >> >>> >>> Xcode does know this. But if you're building for 32-bi

Using fake properties

2013-08-16 Thread Gerriet M. Denkmann
Currently I have stuff like: #if TARGET_OS_IPHONE NSLayoutManager *layoutManager = self.textView.layoutManager; #else // TARGET MAC OS X NSLayoutManager *layoutManager = [ self.textView layoutManager ]; #endif // TAR

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