Re: UIWebView and baseURL?

2010-03-28 Thread Mike Abdullah
nil is fine, just means you can't use relative paths in the HTML. On 29 Mar 2010, at 00:53, William Squires wrote: > If a UIWebView is created with a self-contained HTML code (in a literal > NSString), what's the baseURL supposed to be? I set mine to nil - is this > correct in this case, or is

UIWebView and baseURL?

2010-03-28 Thread William Squires
If a UIWebView is created with a self-contained HTML code (in a literal NSString), what's the baseURL supposed to be? I set mine to nil - is this correct in this case, or is it gonna crash at some point? It seems to work, but I just want to make sure. __

Re: NSTask and pseudo TTY

2010-03-28 Thread James W. Walker
On Mar 28, 2010, at 2:29 PM, Ken Thomases wrote: > On Mar 28, 2010, at 1:56 PM, James W. Walker wrote: > >> I've been running NSTask and reading the output using -[NSFileHandle >> readInBackgroundAndNotify], but in certain situations there was a problem: >> Due to the block buffering of stand

Re: NSTask and pseudo TTY

2010-03-28 Thread Ken Thomases
On Mar 28, 2010, at 1:56 PM, James W. Walker wrote: > I've been running NSTask and reading the output using -[NSFileHandle > readInBackgroundAndNotify], but in certain situations there was a problem: > Due to the block buffering of standard output, I wasn't getting notified as > soon as some o

Re: Creating WebView in code

2010-03-28 Thread Nick Zitzmann
On Mar 28, 2010, at 12:44 PM, Jenny M wrote: > Is it possible I could create it in a xib file and keep it invisible, > and handle closing programmatically so it's not a waste of memory? Yes. > How > would I go about this, or is there an easier way? Subclassing NSView/WindowController, giving i

Re: Wrapping a C function library (as source) in an ObjC class...

2010-03-28 Thread Jens Alfke
On Mar 28, 2010, at 9:32 AM, Clark Cox wrote: >> When importing header files into my >> implementation file ".m", do I #include them or #import them? How about >> existing library headers (like )? > > You can do either. To be precise: #import is just like #include, except that the second #impor

Re: NSTask and pseudo TTY

2010-03-28 Thread James W. Walker
On Mar 28, 2010, at 12:06 PM, John Pannell wrote: > Hi James- > > Depending on your use case, you might be able to shut the buffering off by > something like this... > > setvbuf(stdout, NULL, _IONBF, 0); That would go in the command line tool, not in the client app, right? As I mentioned,

Re: NSTask and pseudo TTY

2010-03-28 Thread John Pannell
Hi James- Depending on your use case, you might be able to shut the buffering off by something like this... setvbuf(stdout, NULL, _IONBF, 0); Hope this helps! John On Mar 28, 2010, at 12:56 PM, James W. Walker wrote: > I've been running NSTask and reading the output using -[NSFileHandle > r

NSTask and pseudo TTY

2010-03-28 Thread James W. Walker
I've been running NSTask and reading the output using -[NSFileHandle readInBackgroundAndNotify], but in certain situations there was a problem: Due to the block buffering of standard output, I wasn't getting notified as soon as some output had been produced. I don't have control over the code

Re: Solving memory leaks

2010-03-28 Thread Michael Davey
OK, thanks for the links, and the help - I am going to read through and apply what I have learned to my code, I have already managed to fix two other leaks as a result of what I have learned. Thank you. On 28 Mar 2010, at 19:03, Philip Mobley wrote: > > On Mar 28, 2010, at 10:42 AM, mmalc Cr

Re: Solving memory leaks

2010-03-28 Thread Michael Davey
I cache the fields array on the first run so that the method is efficient - this is a generic SQLite db wrapper that may potentially be used to access 1000s of rows, and it seems perfectly reasonable that I should be able to store the fields in between SELECTs On 28 Mar 2010, at 19:04, Jack Ca

Creating WebView in code

2010-03-28 Thread Jenny M
Hi all, Going back a bit to my printing problem (http://groups.google.com/ group/cocoa-dev/browse_thread/thread/ cbf57025f0c2a7e0/99d39008358da90b), I'd like to call print on a WebView which loads a locally-generated HTML file that is created specially when my print function is called. So I'd like

Re: Solving memory leaks

2010-03-28 Thread mmalc Crawford
On Mar 28, 2010, at 11:03 am, Philip Mobley wrote: > When calling setFields, you are then responsible for releasing the > "newFields" NSMutableArray you created in your sample code, because > [newFields mutableCopy] increments the ref counter. > This is not correct. [newFields mutableCopy] re

Re: Solving memory leaks

2010-03-28 Thread Philip Mobley
On Mar 28, 2010, at 10:42 AM, mmalc Crawford wrote: >> That would be gut for the fact that my fields are released and set to nil >> whenever a new SELECT query is executed - however, I think I can do this by >> emptying the array when a new query is done and just counting the size of >> the ar

Re: Solving memory leaks

2010-03-28 Thread Klaus Backert
On 28 Mar 2010, at 19:27, Michael Davey wrote: That would be gut for the fact that my fields are released and set to nil whenever a new SELECT query is executed - however, I think I can do this by emptying the array when a new query is done and just counting the size of the array in my fet

Re: Solving memory leaks

2010-03-28 Thread mmalc Crawford
On Mar 28, 2010, at 10:27 am, Michael Davey wrote: > That would be gut for the fact that my fields are released and set to nil > whenever a new SELECT query is executed - however, I think I can do this by > emptying the array when a new query is done and just counting the size of the > array i

Solving memory leaks

2010-03-28 Thread Michael Davey
> -(NSDictionary *)fetch { > NSMutableDictionary *output = nil; > if (db != nil && sth != nil) { > int c = sqlite3_column_count(sth); > if (fields == nil) { > fields = [[NSMutableArray alloc] init]; > for (int i =

Re: Solving memory leaks

2010-03-28 Thread Michael Davey
That would be gut for the fact that my fields are released and set to nil whenever a new SELECT query is executed - however, I think I can do this by emptying the array when a new query is done and just counting the size of the array in my fetch method - thanks... On 28 Mar 2010, at 18:11, Klau

Re: Solving memory leaks

2010-03-28 Thread Klaus Backert
On 28 Mar 2010, at 19:11, Klaus Backert wrote: MyOtherObject *myOtherObject = [fields objectWithKey: ...]; Correction: objectForKey Klaus ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comme

Re: Solving memory leaks

2010-03-28 Thread Klaus Backert
On 28 Mar 2010, at 18:40, Michael Davey wrote: 1. Some other piece of code assigns a new value to 'myFields' without releasing the old value. That is the only part of my code that adds values to the field. In order to handle your fields instance variable correctly, what do you think abou

Re: Solving memory leaks

2010-03-28 Thread Michael Davey
On 28 Mar 2010, at 02:14, Quincey Morris wrote: > On Mar 27, 2010, at 16:51, Noah Desch wrote: > >> If you are *not* using getters and setters but instead have myFields >> declared as: >> >> @interface MyClass >> { >> NSMutableDictionary *myFields; >> } >> >> and you use the above line o

Re: Wrapping a C function library (as source) in an ObjC class...

2010-03-28 Thread Clark Cox
On Sun, Mar 28, 2010 at 9:18 AM, William Squires wrote: > ... and other things. > > 1) I have a C library (as a .c and .h) file. I want to encapsulate this > functionality in an ObjC class. When importing header files into my > implementation file ".m", do I #include them or #import them? How abou

Wrapping a C function library (as source) in an ObjC class...

2010-03-28 Thread William Squires
... and other things. 1) I have a C library (as a .c and .h) file. I want to encapsulate this functionality in an ObjC class. When importing header files into my implementation file ".m", do I #include them or #import them? How about existing library headers (like )? 2) If my C code uses