• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Upper limit to how large an NSString (from url) can be?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Upper limit to how large an NSString (from url) can be?


  • Subject: Upper limit to how large an NSString (from url) can be?
  • From: John Eriksson <email@hidden>
  • Date: Sun, 25 Apr 2004 20:59:32 +0200

Hi.

I'm new to the list so hello everyone. I'm also a beginner when it
comes to Cocoa,
so this might be stupid.

To learn a bit of Cocoa I set out to create a small app that could send
database
queries to a script on a webserver which then returns the result.

I return the result as XML by the way, and found that Cocoa has VERY
basic xml-
support... where's xpath, where's DOM where's anything? I ended up using
the IconaraDom which has proved sufficient, though I couldn't get xpath
working...

So I have a textView and a tableView (which uses an NSArray with
dictionaries as
datasource) so I can see the plain text being returned and also get a
tableview of
the data which is nice.

Everything works very well except one thing, I must keep the rows
returned under
4000 (or something like that) otherwise the NSString becomes nil.

This is the code for sending and receiving the db answer(it's executed
in a separate
thread):

- (void)executeQuery
{

NSAutoreleasePool * pool;
pool = [[NSAutoreleasePool alloc] init];
NSNotificationCenter *nc=[NSNotificationCenter defaultCenter];

//NSLog(@"responseString retainCount: %hu",[responseString
retainCount]);
[responseString release];
responseString=[[NSString stringWithContentsOfURL:surl]
stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[responseString retain];

[nc postNotificationName:@"SCResponseAvailable" object:self];
[pool release];

}

Here responseString becomes nil if the data returned is too large...
why is that? I've verified that
the script on the server does return the rows through a browser so the
problem isn't on the server.

/John Eriksson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Upper limit to how large an NSString (from url) can be?
      • From: John Eriksson <email@hidden>
  • Prev by Date: Re: Java_com_apple_cocoa_application_NSText_scrollRangeToVisible
  • Next by Date: Re: Java_com_apple_cocoa_application_NSText_scrollRangeToVisible
  • Previous by thread: Re: Java_com_apple_cocoa_application_NSText_scrollRangeToVisible
  • Next by thread: Re: Upper limit to how large an NSString (from url) can be?
  • Index(es):
    • Date
    • Thread