Re: __attribute__((NSObject)) not behaving as expected

2014-01-24 Thread Manfred Schwind
Does ist help, if you assign it this way instead: self.context = theContext; In your original code you're directly accessing the backed instance variable instead of going over the property, so maybe your property-declaration is ignored in this case. Regards, Mani Am 24.01.2014 um 19:58

Re: Will this get my iOS app rejected???

2013-09-27 Thread Manfred Schwind
Please see attributedPlaceholder Regards, Mani Am 27.09.2013 um 13:43 schrieb Dave d...@looktowindward.com: Hi, Has anyone else noticed that Placeholder text in UITextFields's is very dim in iOS7? It looks ok in iOS 6, but in 7 it can hardly be seen? I found this hack:

Re: NSSavePanel problem with sandboxing

2013-09-06 Thread Manfred Schwind
the pointer value for the save panel never changes, but the object it points to has some serious changes of identity. For me this sounds like an overrelease or access after release problem. You could try to run with enabled zombie objects. Regards, Mani

Re: Something keeps toggling slow animations

2013-06-30 Thread Manfred Schwind
Hitting the Shift key three times in a row turns slow animations on/off in the Simulator of Xcode 4. Regards, Mani Am 28.06.2013 um 03:33 schrieb Rick Mann rm...@latencyzero.com: I've noticed in the past that suddenly slow animations would be turned on in the simulator. I'm not selecting

UIDocument and non-thread-safe Model

2012-05-27 Thread Manfred Schwind
Hi, when using UIDocument, reading and writing the document is done asynchronously in a separate thread. But there's one thing I don't understand: how is that supposed to be used with non-thread-safe models? In my opinion most straight-forward implemented models are _not_ thread-safe. If you

Re: UIDocument and non-thread-safe Model

2012-05-27 Thread Manfred Schwind
discussed in the documentation? Mani Am 27.05.2012 um 22:49 schrieb Mike Abdullah: The general idea is that you make some kind of copy of your model's state and pass that as the document's content, leaving the background free to write it at its leisure. On 27 May 2012, at 21:35, Manfred

Re: stringWithFormat / Rendering Text (iOS)

2012-05-24 Thread Manfred Schwind
CGContextShowTextAtPoint(contextRef, 0, 40, [textToDraw UTF8String], [textToDraw length]); One bug I see here: you're passing a wrong length parameter. CGContextShowTextAtPoint expects the length of the char array (number of bytes of the UTF-8 encoded string), but you'e passing the

Re: Autolayout: How to force calling [NSView baselineOffsetFromBottom] again?

2012-03-01 Thread Manfred Schwind
Answer to my own question: The baselineOffsetFromBottom seems to be cached by (or in combination with) the corresponding NSLayoutConstraint instance that uses it. When I remove the constraint from its NSView and add it again, then baselineOffsetFromBottom is called again. But I found no other

Autolayout: How to force calling [NSView baselineOffsetFromBottom] again?

2012-02-29 Thread Manfred Schwind
Hi, I have a view hierarchy using Cocoa Autolayout (new in Lion) loaded from a nib. After the nib is loaded, I do some additional configuration for some views (mostly in awakeFromNib). Specifically I have a NSTextField subclass and the additional configuration causes my custom

Detect Siri

2011-11-08 Thread Manfred Schwind
Hi, is there a way to find out if the current device generally supports Siri? I'm not interested if it's currently turned on or off. I just want to know if it is generally possible to use Siri on the current device. I could specifically check for iPhone 4S, but I think that's a bad idea,

Any success with SMLoginItemSetEnabled?

2011-11-05 Thread Manfred Schwind
Hi, has anybody successfully used SMLoginItemSetEnabled? It always returns false for me, whatever I try. When googling, I do not find much about SMLoginItemSetEnabled, but a working alternative using LSSharedFileList calls. Is it OK to use these LSSharedFileList calls instead of

stdout or stderr file path on iPhone?

2011-08-30 Thread Manfred Schwind
Hi, is there a file path to the console output - visible in Xcode, e.g. when calling NSLog, I think it's stderr - on the iPhone? I tried /dev/stderr or /dev/fd/2 (and several other paths) but they do not work and if I get the directory contents of /dev they really don't exist on iOS. stdout

Re: stdout or stderr file path on iPhone?

2011-08-30 Thread Manfred Schwind
From OS/X man pages and I'm thinking this probably works as well on iOS That's what I thought, too. But unfortunately it doesn't work. So e.g., stdout would be /dev/stdout. See if that works for you... Does not work. I tried that: [@\n\nTEST\n\n\n writeToFile:@/dev/stdout

Re: stdout or stderr file path on iPhone?

2011-08-30 Thread Manfred Schwind
Background: I have a third party library (that I am not allowed to change) that logs to a file in Debug mode. I want to see this log output directly in the Xcode console, because transferring log files from the iPhone is too complicated. The library provides an API to set the file path

Re: iTunes Music Library.xml won't load with dictionaryWithContentsOfFile:

2011-08-25 Thread Manfred Schwind
one of my customers is reporting that my app does not find the iTunes Music Library.xml file. Its there and its filled with data. His iTunes runs fine. He send me the file and to my eyes it looks fine. The way i load it is with: NSDictionary * xmldict = [NSDictionary

Re: iTunes Music Library.xml won't load with dictionaryWithContentsOfFile:

2011-08-25 Thread Manfred Schwind
Maybe the file is corrupt. In most cases it can be solved by deleting the XML file and then making a slight change in iTunes (e.g. rename a song). The file is then written again soon and should be fine. Yeah, it’s a strange problem because this file gets rewritten from scratch all the

Re: NIB loading cycle? (sequel to: Dynamically loading NIB files with a common stem)

2011-07-07 Thread Manfred Schwind
On Mac OS X, all top-level objects get an -awakeFromNib. On iOS, top-level objects do not get -awakeFromNib. Uh? This was news to me and I immediately tested this. My tests show: - On OS X all objects of the nib including the file's owner get an awakeFromNib. - On iOS also all objects of the

Re: How can I be so wrong about graphics?

2011-06-07 Thread Manfred Schwind
Hmm... it looks like it does draw the line... way off in the ether somewhere... I think I drew in the global coord system not the local to the view Are you sure you are _not_ calling drawRect yourself, but let the system call it when needed? If a view needs to be redrawn, the system sets up

Re: -[NSColor setBackgroundColor:] not working in 10.6

2010-10-08 Thread Manfred Schwind
- (void)drawRect:(NSRect)rect { [...] [img drawInRect:rect ...]; } Not related to your original problem, but please note that the NSRect passed to drawRect is the dirty area that needs to be redrawn. In many cases this matches self.bounds, but not always. So using this rect as

Update Window of Snow Leopard's Dock Exposé

2010-08-11 Thread Manfred Schwind
Hi, when holding down the mouse button on an running app in Snow Leopard's Dock, you get Exposé showing all the windows of that app. Problem: when the app is hidden, the windows are not updated. You can easily reproduce it e.g. with the QuickTime Player: Play a movie in QuickTime Player and

Re: Discard all drawing in a UIView

2010-07-25 Thread Manfred Schwind
But, the question still does remain, even if purely for academic reasons - can we clear a UIView (in a custom UITableViewCell) in the drawRect routine after beginning to draw in it. I have tried playing around with two options so far 1. CGContextClearRect() - This however clears to a black

Testing background task expiration; lowering backgroundTimeRemaining?

2010-07-13 Thread Manfred Schwind
Hi, is there some way to lower UIApplication's backgroundTimeRemaining property for testing purposes? I want to test the correct behaviour of an App doing some lengthy processing in the background when the background time expires, but I always have to wait 10 Minutes for the timeout ... that's

Re: Testing background task expiration; lowering backgroundTimeRemaining?

2010-07-13 Thread Manfred Schwind
is there some way to lower UIApplication's backgroundTimeRemaining property for testing purposes? I want to test the correct behaviour of an App doing some lengthy processing in the background when the background time expires, but I always have to wait 10 Minutes for the timeout ... that's

Re: Compiler bug?

2010-07-13 Thread Manfred Schwind
NSDictionary* attrs = [[NSFileManager defaultManager] attributesOfItemAtPath: @/some/file/with/finder/comment error:NULL]; NSLog(@extAttrs:%@, [attrs objectForKey:@NSFileExtendedAttributes]); NSLog(@attrs:%@, attrs);

Re: How tell tell if an NSNumber was initialized from a float or int?

2010-06-28 Thread Manfred Schwind
However, I can't figure out how to determine if the NSNumber was initialized with an int or float. NSNumber *myNumber = ...; CFNumberIsFloatType((CFNumberRef)myNumber); Regards, Mani -- http://mani.de - friendly software iVolume - listen to music hands-free LittleSecrets - the encrypted

Re: recursion anxiety

2010-03-25 Thread Manfred Schwind
Can anyone see why the caller is getting the first match, rather than the last? Immense thanks to anyone who can see what's up. I think in the line when going down the recursion, you have to assign the result to endNode: endNode = [self getTrieNodeFromContextSequence:mutableSeq

Re: User-space threads and NSAutoreleasePool

2010-03-18 Thread Manfred Schwind
The problem is that when you call swapcontext() to switch the user-thread running on a kernel-thread, the NSAutoreleasePool stack is not swapped out. It remains rooted in thread-local storage. As a result, serious problems result. Let me give an example. - (void)doStuff {

Re: Float constants

2010-03-18 Thread Manfred Schwind
Still, CGFloat is a pain when using the 64 to 32 bit truncation warning and doing something like: NSRect foo = NSMakeRect (1.0, 2.0, ...) it will warn building as 32 bit since it's implicitly converting double to float. You could do: NSRect foo = NSMakeRect ((CGFloat)1.0,

Re: NSTimer never being deallocated

2010-03-13 Thread Manfred Schwind
I sent an -invalidate to my instance of NSTimer in -fire: but Instruments told me the object was still alive. This is really confusing, I think the instance should be released when sending an invalidate so mem-management is clean and fine as it is in every other Apple ObjC class. This is

Re: Unable to write in InfoPlist.strings file from cpp

2009-12-10 Thread Manfred Schwind
Be careful, though: Some MacOS versions have a bug where .strings files had to be UTF16 to actually work. I don't think Apple has fixed that yet. Do you have more specific information about that? I consequently always used UTF-8 for all my .strings files in every project I ever worked on (for

Re: Unable to write in InfoPlist.strings file from cpp

2009-12-10 Thread Manfred Schwind
Be careful, though: Some MacOS versions have a bug where .strings files had to be UTF16 to actually work. I don't think Apple has fixed that yet. Do you have more specific information about that? I consequently always used UTF-8 for all my .strings files in every project I ever worked on

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Manfred Schwind
I think there is more than one problem here. You may want to get a good book about the C language (Obj-C is just a superset of C). Variables i, cornerSize are passed to the function from a for loop. i being the counter for the loop, cornerSize being the size of corner desired by the user.

Re: Storing values in dictionary with their address as the key

2008-07-29 Thread Manfred Schwind
. Regards, Manfred Schwind -- http://mani.de - friendly software iVolume - listen to music freehand LittleSecrets - the encrypted notepad ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: NSString sizeWithAttributes inaccuracy

2008-07-25 Thread Manfred Schwind
he problem is that on very large strings sizeWithAttributes comes up short [no pun intended] How much too short? Is it less than 1 pixel? float tiw = [self stringPixelWidth:[records objectAtIndex:i]]; if(tiw maxWidth){

Re: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)

2008-06-26 Thread Manfred Schwind
I'm beginning to wonder if it's possible to save and restore the current disclosure state of the hierarchy of a NSOutlineView. I solved this a while ago. Here is what I am doing: I am saving in my model if an item is expanded or collapsed. To keep the model up-to-date, I am doing the

Re: Attack My Code! Part 1

2008-06-13 Thread Manfred Schwind
NSData* data = [ attrString RTFDFromRange:wholeStringRange documentAttributes:nil ]; [ thePasteboard setData:data forType:NSRTFPboardType ]; Either use RTFDFromRange and NSRTFDPboardType or RTFFromRange and NSRTFPboardType, but do not mix them. Maybe that's the reason for the garbage, I

Re: how to know a window finishes resizing

2008-05-07 Thread Manfred Schwind
Would you tell me how to know a window finishes resizing? You may want to look at these NSView methods: - (void)viewWillStartLiveResize; - (void)viewDidEndLiveResize; - (BOOL)inLiveResize; Regards, Mani -- http://www.mani.de iVolume - Loudness adjustment for iTunes. LittleSecrets - The

Re: NSArray retaining and releasing

2008-05-03 Thread Manfred Schwind
NSArray *newArray = [NSArray arrayWithArray:oldArray]; [newArray retain]; Now I it is my responsobolity to send a release message to newArray. But am I responsible to send release messages to the contents of newArray? No, the NSArray is responsible for its items. How do I do a deep copy?

Re: Modal window and 'hanging' menu [SOLVED]

2008-04-30 Thread Manfred Schwind
You probably shouldn't be putting up a modal dialog from within the menu-tracking runloop mode. You can use - performSelector:withObject:afterDelay:inModes: to defer the call that opens the modal dialog; use a delay of 0.0 but a modes array that includes only the default runloop mode.

Modal window and 'hanging' menu

2008-04-29 Thread Manfred Schwind
I have a modal dialog window that pops up at some time. I am doing the modal session with [NSApp runModalForWindow:window]. If the user has clicked into the menu bar just before this modal window opens, the menu is hanging down and can not be closed before the modal window is closed. Is

Re: Inserting my own Responder before App?

2008-04-23 Thread Manfred Schwind
I've got a subclass of NSWindowController (a singleton in my app) inserted after the NSApplication in the responder chain, but is there any way for it to be the last responder before the app, such that Cocoa automatically makes things point first to my responder and then I can pass things

Re: horizontal sizeToFit of NSTextView or NSTextField

2008-04-20 Thread Manfred Schwind
Now I want to be able to calculate the optimal width of the view so that the entire text is visible. This worked wonders for me: http://www.cocoabuilder.com/archive/message/cocoa/2008/3/31/202752 This also does not solve my problem. Getting the height of a text for a given width is easy and

Core Animation layer-backed NSViews and mouse handling

2008-04-08 Thread Manfred Schwind
Hi, I have a layer-backed NSView, say an NSButton (or a complete view hierarchy with many controls), and I am transforming - moving, rotating, etc. - its layer around. Now when I try to click the NSButton at its currently visible position, drawn by the CALayer, it does not work. I have