Re: [iPhone] Custom UIView like in iPhone Messages App

2009-11-07 Thread Tharindu Madushanka
Hi I have been currently doing something like this. In my chat view I have a scroll view and my text field is always with keyboard open. I keep two variables to scale the scroll view content size as the chat messages height get increased over time. So I set the content size bigger if the messages

Re: Pausing an NSThread

2009-11-07 Thread Greg Guerin
Ron Fleckner wrote: I've finally worked out a way to pause a thread and would like to know if what I'm doing is dangerous or bad or...? Exactly what problem are you trying to solve? Pausing a thread is always potentially dangerous. Any locks or @synchronized blocks acquired before reachin

Odd QuickLook generator UTI specification feature/bug

2009-11-07 Thread Dalmazio Brisinda
Has anyone else noticed some odd behavior in specifying UTI document types supported by a custom QuickLook generator? I'm experimenting with overriding several document types, including the high-level general UTI public.content. But it doesn't work. Similarly less, but still quite broad, do

Xcode can't find cpu_capabilities.h?

2009-11-07 Thread Chase Meadors
I'm not sure if this is completely on-topic, but it seemed more relevant here than the xcode list. This issue has come up randomly a few times before, but it seems to be persisting now. All of the sudden, seemingly caused by calling memcpy(), my program freezes with the the message "GDB: Xc

Re: Pausing an NSThread

2009-11-07 Thread Ron Fleckner
On 08/11/2009, at 2:36 PM, Dave DeLong wrote: Instead of a BOOL on the main thread, what about an NSLock? Start off by locking it on the main thread, and then the secondary thread can try to lock it, block (because it can't acquire the lock since the main thread has it), and not resume un

Re: Pausing an NSThread

2009-11-07 Thread Kyle Sluder
On Sat, Nov 7, 2009 at 7:28 PM, Ron Fleckner wrote: > This is a small proof-of-concept/test kind of project. I've had a look at > NSConditionLock, but I don't get the concepts.  So I've got this naïve > solution, which is a kind of polling, I know, but it _seems_ to work quite > well.  The CPU usa

Re: Pausing an NSThread

2009-11-07 Thread Dave DeLong
Instead of a BOOL on the main thread, what about an NSLock? Start off by locking it on the main thread, and then the secondary thread can try to lock it, block (because it can't acquire the lock since the main thread has it), and not resume until the main thread unlocks it (equivalent to t

Pausing an NSThread

2009-11-07 Thread Ron Fleckner
Hi all, I've finally worked out a way to pause a thread and would like to know if what I'm doing is dangerous or bad or...? This is a small proof-of-concept/test kind of project. I've had a look at NSConditionLock, but I don't get the concepts. So I've got this naïve solution, which is a

Re: NSString of selected text in NSTextView

2009-11-07 Thread Douglas Davidson
NSTextView will generally make sure that the selection is a reasonable range. One complication is that in general NSTextView supports multiple discontiguous selected ranges. If such a selection is in use then just calling -selectedRange will not capture all of it. If there are attachments i

Re: NSString of selected text in NSTextView

2009-11-07 Thread Douglas Davidson
NSTextView will usually take care of making sure that the selection is a reasonable range. One complication is that in general NSTextView supports multiple discontiguous selection ranges, and if such a selection is in use, calling just -selectedRange will ignore it. On Nov 7, 2009, at 6:0

Re: [iPhone] Custom UIView like in iPhone Messages App

2009-11-07 Thread Greg Reichow
I am trying to implement a custom ui view with a background image to append chat messages into a scroll view like in iPhone default Messages SMS App. But I have few things to clarify. If its multiple lines how can I remove the image scaling so that it would not look like that background

Re: [iPhone] Custom UIView like in iPhone Messages App

2009-11-07 Thread Luke Hiesterman
You want to have a view that scales to multiple lines, and you want that view to have a background. You further I desire said background to not scale. Am I missing something? That doesn't make sense. Luke Sent from my iPhone. On Nov 7, 2009, at 5:42 PM, Tharindu Madushanka wrote: Hi,

Best implementation for iTunes-like playlist structure?

2009-11-07 Thread Dave DeLong
Hi everyone, I'm creating an app that has a master-detail interface, similar to iTunes. It has the same data hierarchy as iTunes' playlists (except that I'm not allowing groups of "playlists" to keep things simple). In other words, there are normal playlists where their only items are a

Re: NSObjectController Content Delay

2009-11-07 Thread Kyle Sluder
On Sat, Nov 7, 2009 at 5:26 PM, Richard Somers wrote: > The problem is I need to know if the controller has content or not on the > initial run loop. Is there any way to force the issue? Why do you need this timing? Usually you could just get away with binding to the controller's selection. If

Re: AHGoToPage function

2009-11-07 Thread Ian Piper
On 8 Nov 2009, at 01:47, Ian Piper wrote: Hi all, I hope someone can illuminate me. Erm, I just illuminated myself. First, I was typing AHGoToPage, not AHGotoPage (though I think my version looks nicer). Second, I hadn't added the Carbon Framework. Now that I have done both, it works fine

Re: Embedded Frameworks in Plugin & Action Bundles

2009-11-07 Thread Kyle Sluder
On Sat, Nov 7, 2009 at 7:38 AM, Samuel Ford wrote: > I understand the nature of the problem -- the library path is wrong, it > should be relative to the loader path not the executable (which, of course, > is Automator.app, not my action). If you are also using RegexKit in your app, and have bundl

Re: NSString of selected text in NSTextView

2009-11-07 Thread Mark Gallegly
Here is one: -(NSString*) getSelectedTextInTextView:(NSTextView*)theTextView { NSRange range = [theTextView selectedRange]; NSData* rtfData = [theTextView RTFFromRange: range]; NSAttributedString* aStr = [[NSAttributedString alloc] initWithRTFData:rtfData documentAttributes: NU

Re: NSString of selected text in NSTextView

2009-11-07 Thread Kyle Sluder
On Sat, Nov 7, 2009 at 5:57 PM, Todd Heberlein wrote: > This seems like a simple task, but it has become a series of steps. Am I > missing a simple method that will do this? [[myTextView string] substringWithRange:[myTextView selectedRange]; (Warning, composed in Mail. Potential thorny issues w

NSString of selected text in NSTextView

2009-11-07 Thread Todd Heberlein
This seems like a simple task, but it has become a series of steps. Am I missing a simple method that will do this? I have a Text View and want to get the selected text in an NSString form. I can get an NSString for the entire NSTextView (-string), but to get the string for just the selecte

Re: Porting non-Mac OS X app to Cocoa

2009-11-07 Thread Rob Barris
Can this be rephrased in terms of "I would like to find or write a function that I can call periodically from my own processing loop, that handles all the Cocoa activities and dispatching of events, such that I do not have to use the Cocoa provided runloop ?" On Thu, Nov 5, 2009 at 3:56 PM, Kevin

Embedded Frameworks in Plugin & Action Bundles

2009-11-07 Thread Samuel Ford
OK, I know this should be easy, but I can't figure it out. I have an Automator action bundle that uses RegexKit as an embedded framework in the bundle. The action won't load, though, because of this error: Library not loaded: @executable_path/../Frameworks/RegexKit.framework/ Versions/A/Re

AHGoToPage function

2009-11-07 Thread Ian Piper
Hi all, I hope someone can illuminate me. I have been trying to follow the Developer Documentation example for AHGoToPage. I have connected a help button in the UI to an action called loadHelpForJournalEntry. This is intended to load a help file called index.html. The help files themselve

[iPhone] Custom UIView like in iPhone Messages App

2009-11-07 Thread Tharindu Madushanka
Hi, I am trying to implement a custom ui view with a background image to append chat messages into a scroll view like in iPhone default Messages SMS App. But I have few things to clarify. If its multiple lines how can I remove the image scaling so that it would not look like that background image

NSObjectController Content Delay

2009-11-07 Thread Richard Somers
I have a NSObjectController bound to a managed object context. The controller automatically prepares content. When opening an existing document the controller has content but during the initial run loop the content is null. On the second run loop the controller has finally found the content

Re: NSString's handling of Unicode extension B (and C) characters

2009-11-07 Thread John Engelhart
On Sat, Nov 7, 2009 at 11:01 AM, Alastair Houghton < alast...@alastairs-place.net> wrote: > On 7 Nov 2009, at 14:17, Ryan Homer wrote: > > On 2009-11-06, at 12:42 PM, Clark Cox wrote: >> >> Is "ü" a single character, or two characters? >>> >> >> When you define a string using ü, isn't it stored

Re: Package Maker Won't Install on Snow Leopard

2009-11-07 Thread Matthew Lindfield Seager
Hi John, You may get a better response posting on Installer-Dev... http://lists.apple.com/mailman/listinfo/installer-dev Matt ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Package Maker Won't Install on Snow Leopard

2009-11-07 Thread John Nairn
I just finished a Cocoa App, created installation package, but it won't install. The package builds fine. I look in the contents of the package and resources for my app are there. I run the package and it goes through "successful" installation. But when done the application is no where to b

Re: NSString's handling of Unicode extension B (and C) characters

2009-11-07 Thread Clark Cox
On Sat, Nov 7, 2009 at 6:17 AM, Ryan Homer wrote: > [SOLVED] > > On 2009-11-06, at 12:42 PM, Clark Cox wrote: > >> On Fri, Nov 6, 2009 at 5:22 AM, Ryan Homer wrote: >>> >>> On 2009-11-05, at 1:42 PM, Clark Cox wrote: >>> >>> Yes. I am importing characters from a text file and need to process them

Re: What is the best way to determine what type of removable media is inserted? (ie: DMG)

2009-11-07 Thread Greg Guerin
Robert Monaghan wrote: How does one figure out what type of removable volume is mounted? Use the 'hdiutil' command to get info on dmg's. For example: hdiutil info or: hdiutil info -plist You can also correlate its output to statfs()-returned data. -- GG ___

What is the best way to determine what type of removable media is inserted? (ie: DMG)

2009-11-07 Thread Robert Monaghan
Hi Everyone, Is there a way to determine if a mounted "removable" volume is a DMG or not? I need to distinguish between a USB Stick and a DMG in my app. I have played with statfs(), but I can't seem to figure out a tangible/concrete difference. How does one figure out what type of removable vol

Re: Core-Data : how to merge two contexts ?

2009-11-07 Thread BJ Homer
> > > I'll probably end up using the "merge..." method available but that makes > me feel bad to save a document automatically when the user should be the > only one responsible for this. For example, the user will not be able to use > the "Revert" command from the File menu to restore his document

Re: NSString's handling of Unicode extension B (and C) characters

2009-11-07 Thread Alastair Houghton
On 7 Nov 2009, at 14:17, Ryan Homer wrote: On 2009-11-06, at 12:42 PM, Clark Cox wrote: Is "ü" a single character, or two characters? When you define a string using ü, isn't it stored internally as one UTF-16 code unit (not sure if I'm using the notation correctly), represented as U+00FC

Re: popup menu entries

2009-11-07 Thread Carlo Caione
On Nov 7, 2009, at 5:41 AM, Graham Cox wrote: On 07/11/2009, at 7:19 AM, Carlo Caione wrote: in an application I need to populate a popup button with at least twenty entries. What is the correct place where I have to store labels? Can a property list be a good idea or is it better to leave

Re: NSString's handling of Unicode extension B (and C) characters

2009-11-07 Thread Ryan Homer
[SOLVED] On 2009-11-06, at 12:42 PM, Clark Cox wrote: On Fri, Nov 6, 2009 at 5:22 AM, Ryan Homer wrote: On 2009-11-05, at 1:42 PM, Clark Cox wrote: Yes. I am importing characters from a text file and need to process them in a certain way. A word may have an alternate form which is denoted

Re: Core-Data : how to merge two contexts ?

2009-11-07 Thread Eric Morand
But why don’t you want to save? If you just want your objects in memory, why use CoreData at all? Hi atze, I'll probably end up using the "merge..." method available but that makes me feel bad to save a document automatically when the user should be the only one responsible for this. For ex

Re: Core-Data : how to merge two contexts ?

2009-11-07 Thread Alexander Spohr
Am 07.11.2009 um 09:39 schrieb Eric Morand: The NSManagedObjectContext is your scratchpad. If you want something inside it fetch it or create it. If you change something, the change will be promoted. Hi atze, Actually, the change will be promoted only when they are committed to the stor

Re: Core-Data : how to merge two contexts ?

2009-11-07 Thread Eric Morand
The NSManagedObjectContext is your scratchpad. If you want something inside it fetch it or create it. If you change something, the change will be promoted. Hi atze, Actually, the change will be promoted only when they are committed to the store, and that implies a save on the disk. Or