Re: How to get selected text in a WebView

2010-10-04 Thread Gary L. Wade
Was there a problem with what dr.text or [dr toString] returned after your first line? On 10/04/2010 12:15 AM, "Gerriet M. Denkmann" wrote: > I have a Webview, and I want to do something with the selected text. > > I tried: > DOMRange *dr = [ webView selectedDOMRange ]; > NSString *m = [ dr ma

Re: How to get selected text in a WebView

2010-10-04 Thread Gerriet M. Denkmann
On 5 Oct 2010, at 00:45, Keary Suska wrote: > On Oct 4, 2010, at 1:15 AM, Gerriet M. Denkmann wrote: > >> I have a Webview, and I want to do something with the selected text. >> >> I tried: >> DOMRange *dr = [ webView selectedDOMRange ]; >> NSString *m = [ dr markupString ]; >> this contains t

Re: allKeys and allValues

2010-10-04 Thread gMail.com
Ok, I will not rely on that. Anyway, I have seen that iTunes uses the same dictionary structure. The file "iTunes Music Library.xml" contains a dictionary called Tracks. This dict contains a series of dictionaries with an ID as key. So it's very easy to get a track's dict asking for e.g. [track

Re: allKeys and allValues

2010-10-04 Thread Dave DeLong
Or do something like: NSArray * allKeys = [dictionary allKeys]; NSArray * allValues = [dictionary objectsForKeys:allKeys notFoundMarker:[NSNull null]]; This also guarantees a 1-to-1 correspondance. Dave On Oct 4, 2010, at 3:40 PM, Greg Parker wrote: > The documentation for CFDictionaryGetKeys

Re: allKeys and allValues

2010-10-04 Thread Greg Parker
On Oct 4, 2010, at 2:31 PM, Ken Thomases wrote: > On Oct 4, 2010, at 4:21 PM, gMail.com wrote: >> On the docs I read that for both the NSDictionary's allKeys and allValues, >> the order of the elements in the array is not defined. Ok. >> But, are the two arrays aligned each other? > > If the docs

Re: allKeys and allValues

2010-10-04 Thread Ken Thomases
On Oct 4, 2010, at 4:21 PM, gMail.com wrote: > On the docs I read that for both the NSDictionary's allKeys and allValues, > the order of the elements in the array is not defined. Ok. > But, are the two arrays aligned each other? If the docs don't contain that promise, then you can't rely on it.

Re: allKeys and allValues

2010-10-04 Thread Nick Zitzmann
On Oct 4, 2010, at 3:21 PM, gMail.com wrote: > On the docs I read that for both the NSDictionary's allKeys and allValues, > the order of the elements in the array is not defined. Ok. > But, are the two arrays aligned each other? > > I mean, I have a dictionary containing several entries whose ke

allKeys and allValues

2010-10-04 Thread gMail.com
Hi, On the docs I read that for both the NSDictionary's allKeys and allValues, the order of the elements in the array is not defined. Ok. But, are the two arrays aligned each other? I mean, I have a dictionary containing several entries whose key is, e.g. @"0", @"3", @"42",... I show these entries

Re: What does core data do during a Save As?

2010-10-04 Thread Melissa J. Turner
On Oct 1, 2010, at 10:02 PM, Jerry Krinock wrote: > > On 2010 Oct 01, at 10:44, Quincey Morris wrote: > >> Core Data implements Save As as a migration process using a mapping model >> that it constructs on the fly > > Eeek. I never knew that. > I'm late to the game, but this is incorrect.

Re: clear a CGContextRef in an iPhone app

2010-10-04 Thread Matt Neuburg
I have to wonder why you're going to all this trouble when UIGraphicsBeginImageContext exists. What exactly are you planning on doing, ultimately, with this context? And why do you need to clear the entire thing after you've drawn into it? m. On Mon, 4 Oct 2010 11:34:23 -0700, Rainer Standke said

Re: What does core data do during a Save As?

2010-10-04 Thread Jerry Krinock
On 2010 Oct 04, at 09:07, Sean McBride wrote: > For example, during development, the model can be in > flux, and it would be nice to be able to diff one's changes before > committing to SCM. I believe you could create a mapping model, use it for diff, and then trash it._

NSTextView Line Endings

2010-10-04 Thread koko
I haven't seen anything thong on this, so here goes: Can the line endings in an NSTexyView be changed from UNIX (lf) to windows (crlf). -koko ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator com

MPMusicPlayerController queue index?

2010-10-04 Thread Eric E. Dolecki
I have buttons that track back / next track. I am displaying the Now Playing artwork for the song in a UIScrollView. There is a static UILabel below that control. When one uses a button, is there a queue index in the MPMusicPlayer I can query or some technique other than handling that all myself w

Re: clear a CGContextRef in an iPhone app

2010-10-04 Thread David Duncan
On Oct 4, 2010, at 11:34 AM, Rainer Standke wrote: > This is indeed outside of -drawRect, and it's a context I create myself, like > so: Then you will need to show more code, specifically the code that is showing the issue you are experiencing, because none of the code you've shown thus far s

Re: clear a CGContextRef in an iPhone app

2010-10-04 Thread Rainer Standke
This is indeed outside of -drawRect, and it's a context I create myself, like so: // returns a new 'abstract' graphics context to draw in: CGContextRefcontext = NULL; CGColorSpaceRef colorSpace; void * bitmapData; int bitmapByteCount; int

Re: info.plist with DYLD_LIBRARY_PATH = ~/test

2010-10-04 Thread Kyle Sluder
On Mon, Oct 4, 2010 at 11:11 AM, Greg Parker wrote: > On Oct 2, 2010, at 6:54 PM, Kyle Sluder wrote: > > Maybe weak linking can help here. If you weak link the Python library and > call dlopen early on in your program's lifetime with the appropriate path, I > think dyld will populate all the weak

Re: clear a CGContextRef in an iPhone app

2010-10-04 Thread David Duncan
On Oct 4, 2010, at 11:04 AM, Rainer Standke wrote: > wondering how to clear a context. I'm using this: > > CGContextClearRect(context, drawingRect); > > But yet, afetr I do that, and then start to draw something new, I get > remnants of the previous content of the context. Where are you calli

Re: info.plist with DYLD_LIBRARY_PATH = ~/test

2010-10-04 Thread Greg Parker
On Oct 2, 2010, at 6:54 PM, Kyle Sluder wrote: > Maybe weak linking can help here. If you weak link the Python library and > call dlopen early on in your program's lifetime with the appropriate path, I > think dyld will populate all the weak linked functions it finds. No, weak linking doesn't do

Re: Instantly delete a directory without recursion?

2010-10-04 Thread Greg Parker
On Oct 4, 2010, at 1:24 AM, Oleg Krupnov wrote: > I had an idea that because the directory tree is growing from a single > root, there *might* be a possibility to axe it off with a single hit. > Is it possible? As Kirk explained, no. Another reason is file permissions. The filesystem needs to ch

clear a CGContextRef in an iPhone app

2010-10-04 Thread Rainer Standke
Hello, wondering how to clear a context. I'm using this: CGContextClearRect(context, drawingRect); But yet, afetr I do that, and then start to draw something new, I get remnants of the previous content of the context. My workaround is to create brand new context for the second drawing, but sh

Re: Interacting Sizes of NSScrollView and its NSClipView and a Custom NSView

2010-10-04 Thread Keary Suska
On Oct 4, 2010, at 9:22 AM, Thomas Wetmore wrote: > I have a question based on my confusion over the interacting behaviors of an > NSScrollView, its NSClipView and a custom NSView being displayed and clipped. > > I have an NSScrollView which resizes as its window resizes. Therefore the > NSCli

Re: How to get selected text in a WebView

2010-10-04 Thread Keary Suska
On Oct 4, 2010, at 1:15 AM, Gerriet M. Denkmann wrote: > I have a Webview, and I want to do something with the selected text. > > I tried: > DOMRange *dr = [ webView selectedDOMRange ]; > NSString *m = [ dr markupString ]; > this contains the selected characters, but buried in lots of markup lan

Re: What does core data do during a Save As?

2010-10-04 Thread Sean McBride
On Sat, 2 Oct 2010 04:28:20 +1000, Gideon King said: >The next thing I'm dreading with Core Data is trying to get autosave to >work. I got some tips from Ben Trumbull, but it looks like a scary >amount of work that I don't fully understand...but that's for another day... Hear hear. It's sad that

Re: Hitting Layers

2010-10-04 Thread Curious Yogurt
I solved the problem by examining checking to see if the game was in fullscreen mode, and then changing how the NSPoint was calculated. It turns out that everything was slightly offset in fullscreen mode when using convertScreetToBase:. Not exactly a solution with an explanation; but at least it

Re: What does core data do during a Save As?

2010-10-04 Thread Sean McBride
On Sat, 2 Oct 2010 06:35:21 -0700, Jerry Krinock said: >> I have no tool to diff models > >When you create a mapping model between two data models, there is a >"Show Differences" button in the upper left corner. Which is nice, but there seems to be no way to diff two .xcdatamodels in the general

Re: Adding subviews to collapsed splitview

2010-10-04 Thread Gideon King
Thanks for the tip Rainer - with that, I was able to track down the problem by adding the subview directly to the outer split view. Thanks again for providing such a useful component. Regards Gideon On 02/10/2010, at 5:48 AM, Rainer Brockerhoff wrote: > > Is there any special reason for you

Interacting Sizes of NSScrollView and its NSClipView and a Custom NSView

2010-10-04 Thread Thomas Wetmore
I have a question based on my confusion over the interacting behaviors of an NSScrollView, its NSClipView and a custom NSView being displayed and clipped. I have an NSScrollView which resizes as its window resizes. Therefore the NSClipView resizes within the NSScrollView as the the window resize

[iPhone] Changing iPhone Application Language Programatically.

2010-10-04 Thread Tharindu Madushanka
Hi, I would like to know whether its possible to change to a language other than provided list of languages in iPhone Settings. By default using localized .lproj folders & .strings files we could make applicaton localized into selected language. For example, Languages like Sinhala are not in thos

Re: Property list file with NSNumber objects as keys

2010-10-04 Thread Remco Poelstra
Op 4-10-2010 14:55, Roland King schreef: http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/PropertyLists/AboutPropertyLists/AboutPropertyLists.html%23//apple_ref/doc/uid/1048i-CH3-46719-CJBIGFCD No. writeToFile: writes a property list representation of the dictionary and

Re: Property list file with NSNumber objects as keys

2010-10-04 Thread Roland King
It has to be strings because that's the definition of a property list and that method writes a property list representation. On 04-Oct-2010, at 9:00 PM, Remco Poelstra wrote: > Op 4-10-2010 14:55, Roland King schreef: >> http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/Pro

Property list file with NSNumber objects as keys

2010-10-04 Thread Remco Poelstra
Hi, In the NSDictionary documentation it is stated that NSNumber objects are valid property list objects. But when I create a dictionary with NSNumbers as keys, writeToFile: fails. If I use strings, then it succeeds. Is it possible to use NSNumbers as keys and have the, read/written from/to fil

Re: Property list file with NSNumber objects as keys

2010-10-04 Thread Roland King
http://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/PropertyLists/AboutPropertyLists/AboutPropertyLists.html%23//apple_ref/doc/uid/1048i-CH3-46719-CJBIGFCD No. writeToFile: writes a property list representation of the dictionary and from the above you can see that NSDiction

Re: Instantly delete a directory without recursion?

2010-10-04 Thread Oleg Krupnov
Thanks everyone! Now I see. Oleg. On Mon, Oct 4, 2010 at 4:14 PM, Kirk Kerekes wrote: >> Is there a way to delete a directory instantly and completely without >> first deleting all its subdirectories and files recursively? > > The hierarchical structure that you see is not "real" -- directories

Re: Instantly delete a directory without recursion?

2010-10-04 Thread Michael Watson
If you unlinked just the top-level directory node, you would leave all of its descendents with a link count > 0, and the corresponding blocks claimed by the descendents would never be freed. (Ever. No one would have a reference to them, and they'd never be found in subsequent traversals.) To reg

Re: Instantly delete a directory without recursion?

2010-10-04 Thread Guillem Palou
I don't think so, If time is a constraint, try running the delete process in a background thread, if it is not a problem. On Oct 4, 2010, at 10:24 AM, Oleg Krupnov wrote: > Hi Guillem, > > You are correct, in many cases the number of files will not be big, so > it should not matter too much, b

Images / ImageRep

2010-10-04 Thread Amy Gibbs
Hi, I'm trying to add a feature to my application, where it collects all of the images related to an entity, and puts them into an image in a grid, so I'm planning on looping through the images, scaling them down then placing them onto a new(blank) image, changing the placement point each

Re: Instantly delete a directory without recursion?

2010-10-04 Thread Stephen J. Butler
No; the OS doesn't support this. From the lowest levels I can think of... One the posix side, you call rmdir() and that only works if the directory is empty (witht the exception of '.' and '..'). On the Carbon FileManager side, you call FSDeleteObject() and again, that only works if the directory

Re: Instantly delete a directory without recursion?

2010-10-04 Thread Oleg Krupnov
Let me make the question more clear: I am aware of functions like [NSFileManager removeItemAtPath: error:], but what they do under the hood is they iterate through the subdirectories and files and delete them first. This takes some time. I am interested if it is possible to do this instantly, witho

Re: Instantly delete a directory without recursion?

2010-10-04 Thread Robert Tillyard
Hello, Oleg, If you're worried about the time this would take and you need an instant results you could rename the folder (which is virtually instantaneous) then remove the renamed folder and it's contents in a background thread. Regards, Rob. On 4 Oct 2010, at 09:03, Oleg Krupnov wrote: > Hi

How to get selected text in a WebView

2010-10-04 Thread Gerriet M. Denkmann
I have a Webview, and I want to do something with the selected text. I tried: DOMRange *dr = [ webView selectedDOMRange ]; NSString *m = [ dr markupString ]; this contains the selected characters, but buried in lots of markup language. But I just want the characters. NSString *s= [ dr stringRep

Instantly delete a directory without recursion?

2010-10-04 Thread Oleg Krupnov
Hi, Is there a way to delete a directory instantly and completely without first deleting all its subdirectories and files recursively? Thanks. Oleg. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Why isn't this delegate protocol being seen?

2010-10-04 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/3/10 10:11 PM, G S wrote: > Hi all. I'm getting a compiler warning that this delegate protocol > isn't defined, when it most certainly is defined in the > CLLocationManager.h file that I've included: > > #import > #import "CoreLocation/CLLocat

Why isn't this delegate protocol being seen?

2010-10-04 Thread G S
Hi all. I'm getting a compiler warning that this delegate protocol isn't defined, when it most certainly is defined in the CLLocationManager.h file that I've included: #import #import "CoreLocation/CLLocation.h" #import "CoreLocation/CLLocationManager.h" @interface MyController : UIViewControl

Re: Why isn't this delegate protocol being seen?

2010-10-04 Thread Gregory Weston
G S wrote: >> No it's not. CLLocationManagerDelegate is defined in >> CLLocationManagerDelegate.h. CLLocationManager.h only includes a >> forward reference to the protocol. > > Aha, right-O. Thanks. I had just done a quick search and found the > string in there, and left it at that. I have a b

Re: Why isn't this delegate protocol being seen?

2010-10-04 Thread G S
> No it's not. CLLocationManagerDelegate is defined in > CLLocationManagerDelegate.h. CLLocationManager.h only includes a > forward reference to the protocol. Aha, right-O. Thanks. I had just done a quick search and found the string in there, and left it at that. I have a bunch of examples that

Re: Instantly delete a directory without recursion?

2010-10-04 Thread Oleg Krupnov
Hi Guillem, You are correct, in many cases the number of files will not be big, so it should not matter too much, but using the opportunity, I decided to illuminate myself regarding the possibilities there are in the file system. I had an idea that because the directory tree is growing from a sin

Re: Instantly delete a directory without recursion?

2010-10-04 Thread Guillem Palou
When removing directories, the OS should remove all the tree created in the filesystem. I think you cannot do anything else? Is it so critical? How many files do you have to delete? On Oct 4, 2010, at 10:12 AM, Oleg Krupnov wrote: > Let me make the question more clear: I am aware of functions li

Re: Why isn't this delegate protocol being seen?

2010-10-04 Thread Kyle Sluder
On Sun, Oct 3, 2010 at 10:11 PM, G S wrote: > Hi all.  I'm getting a compiler warning that this delegate protocol > isn't defined, when it most certainly is defined in the > CLLocationManager.h file that I've included: No it's not. CLLocationManagerDelegate is defined in CLLocationManagerDelegate

Re: Why isn't this delegate protocol being seen?

2010-10-04 Thread Roland King
Why not just include all of CoreLocation and have you added CoreLocation to your framework list in Xcode. On Oct 4, 2010, at 13:11, G S wrote: > Hi all. I'm getting a compiler warning that this delegate protocol > isn't defined, when it most certainly is defined in the > CLLocationManager.h

RE:Instantly delete a directory without recursion?

2010-10-04 Thread Kirk Kerekes
> Is there a way to delete a directory instantly and completely without > first deleting all its subdirectories and files recursively? The hierarchical structure that you see is not "real" -- directories are not physical containers for the files that they appear to contain. The directory hierarc