Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Objective-c > Re: I must be m...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 40 Topic 980 of 1039
Post > Topic >>

Re: I must be missing something... (Categories)

by Don Bruder <dakidd@[EMAIL PROTECTED] > May 13, 2008 at 02:54 PM

In article <uce-880A16.15415213052008@[EMAIL PROTECTED]
>,
 Gregory Weston <uce@[EMAIL PROTECTED]
> wrote:

> In article <C9udnUxkxp0jQrTVnZ2dnUVZ_rvinZ2d@[EMAIL PROTECTED]
>,
>  Don Bruder <dakidd@[EMAIL PROTECTED]
> wrote:
> 
> > > Are you getting any warnings? Particularly at the point where this
is 
> > > invoked, rather that in this method itself?
> > 
> > No. None whatsoever. The build process is 100% error- and warning-free

> > for all compilation units. Even after a "Clean All Targets" then
rebuild 
> > from scratch process.
> 
> That's very odd. I just took a stab at creating a test project to 
> exercise your code and got two errors out of it.
> 
> NSString>>getCString: doesn't return a char* (or anything, for that 
> matter). Two of your printf() statements should be DOA.

Erk!!! You're right! It doesn't return anything! D'OH!!!

Having noticed that, though, that shouldn't render the printf()s DOA - 
That's a logical error, not a syntax error. At worst, it should make the 
non-literal part of the output garbage, but at least print out the 
literal stuff correctly. Or at least, so I would expect based on the 
behavior I've observed in various C compilers over the years.

I'm not getting even that much. And it still doesn't cover the fact that 
not even the "Entering findNSString" one is showing up - That one is 
perfectly fine, both logically and syntactically, so when the method 
gets called, I should at least see that message. And I SHOULD be able to 
set a breakpoint in findNSString and have the debugger stop there.

But...

Lemme prune out the suspect printf()s and see what happens.

No joy... the "bad" printf()s are gone, but the situation remains 
unchanged.

 
> Removing those, I can't get it to work. I get the debugging printf()s, 
> but not any successful invocation on a simple testcase. I believe the 
> reason I can't get it to work is that stringWithCharacters:length: 
> expects the first argument to be an array of unichar. I have a hunch 
> that (the strings within) your data are in some single-byte encoding.

Ouch... That's a REALLY likely scenario, now that you bring it up... 
"Buffer" (The NSMutableData instance variable of the caller) is getting 
loaded from a web page, so it's almost certainly 8-bit ASCII, and I 
didn't read close enough to notice that stringWithCharacters wants a 
unichar array rather than a "plain char" array.

Testing that theory, though, shows it's not "THE" problem, just "A" 
problem. Changed the "TempString =" line to "TempString = [NSString 
stringWithCString:"Testing!"];" and the situation remains the same: 
Can't step into findNSString, no printf() output, no stop at breakpoint, 
and zero in the caller's return variable.

There's something "more basic" wrong with what I'm doing, I'm thinking, 
but I'm just too green in Objective C to spot whatever it is.

-- 
Don Bruder - dakidd@[EMAIL PROTECTED]
 - If your "From:" address isn't on my
whitelist,
or the subject of the message doesn't contain the exact text
"PopperAndShadow"
somewhere, any message sent to this address will go in the garbage without
my
ever knowing it arrived. Sorry... <http://www.sonic.net/~dakidd>
for more
info
 




 40 Posts in Topic:
I must be missing something... (Categories)
Don Bruder <dakidd@[EM  2008-05-13 08:37:26 
Re: I must be missing something... (Categories)
Tom Harrington <tph@[E  2008-05-13 10:18:36 
Re: I must be missing something... (Categories)
Gregory Weston <uce@[E  2008-05-13 13:44:52 
Re: I must be missing something... (Categories)
Don Bruder <dakidd@[EM  2008-05-13 11:10:55 
Re: I must be missing something... (Categories)
Gregory Weston <uce@[E  2008-05-13 13:44:44 
Re: I must be missing something... (Categories)
Don Bruder <dakidd@[EM  2008-05-13 11:36:45 
Re: I must be missing something... (Categories)
Gregory Weston <uce@[E  2008-05-13 15:28:22 
Re: I must be missing something... (Categories)
Gregory Weston <uce@[E  2008-05-13 15:41:52 
Re: I must be missing something... (Categories)
Don Bruder <dakidd@[EM  2008-05-13 14:54:17 
Re: I must be missing something... (Categories)
Gregory Weston <uce@[E  2008-05-13 18:04:18 
Re: I must be missing something... (Categories)
William Yeo <wcyeo@[EM  2008-05-13 15:14:21 
Re: I must be missing something... (Categories)
Don Bruder <dakidd@[EM  2008-05-13 16:02:00 
Re: I must be missing something... (Categories)
William Yeo <wcyeo@[EM  2008-05-13 16:41:09 
Re: I must be missing something... (Categories)
Don Bruder <dakidd@[EM  2008-05-13 18:15:56 
Re: I must be missing something... (Categories)
William Yeo <wcyeo@[EM  2008-05-13 21:38:25 
Re: I must be missing something... (Categories)
Gregory Weston <uce@[E  2008-05-14 07:28:07 
Questions about memory management (was Re: I must be missing som
Don Bruder <dakidd@[EM  2008-05-23 11:01:11 
Re: Questions about memory management (was Re: I must be missing
Gregory Weston <uce@[E  2008-05-23 17:22:47 
Re: Questions about memory management (was Re: I must be missing
Don Bruder <dakidd@[EM  2008-05-23 20:20:10 
Re: Questions about memory management (was Re: I must be missing
William Yeo <wcyeo@[EM  2008-05-23 20:59:14 
Re: Questions about memory management (was Re: I must be missing
Don Bruder <dakidd@[EM  2008-05-23 21:49:26 
Re: Questions about memory management (was Re: I must be missing
Gregory Weston <uce@[E  2008-05-24 09:01:37 
Re: Questions about memory management (was Re: I must be missing
Don Bruder <dakidd@[EM  2008-05-24 22:06:12 
Re: Questions about memory management (was Re: I must be missing
Gregory Weston <uce@[E  2008-05-25 08:29:49 
Re: Questions about memory management (was Re: I must be missing
Don Bruder <dakidd@[EM  2008-05-25 11:23:08 
Re: Questions about memory management
Sherman Pendley <spamt  2008-05-25 17:34:26 
Re: Questions about memory management (was Re: I must be missing
William Yeo <wcyeo@[EM  2008-05-24 13:11:43 
Re: Questions about memory management (was Re: I must be missing
Don Bruder <dakidd@[EM  2008-05-24 22:20:17 
Re: Questions about memory management (was Re: I must be missing
William Yeo <wcyeo@[EM  2008-05-24 23:37:13 
Re: Questions about memory management (was Re: I must be missing
Don Bruder <dakidd@[EM  2008-05-25 10:22:16 
Re: Questions about memory management (was Re: I must be missing
William Yeo <wcyeo@[EM  2008-05-25 10:59:31 
Re: Questions about memory management (was Re: I must be missing
Don Bruder <dakidd@[EM  2008-05-25 11:43:32 
Re: Questions about memory management (was Re: I must be missing
Gregory Weston <uce@[E  2008-05-25 15:27:50 
Re: Questions about memory management (was Re: I must be missing
Don Bruder <dakidd@[EM  2008-05-25 13:07:37 
Re: Questions about memory management (was Re: I must be missing
Gregory Weston <uce@[E  2008-05-26 07:30:16 
Re: Questions about memory management (was Re: I must be missing
Don Bruder <dakidd@[EM  2008-05-26 07:30:02 
Re: Questions about memory management (was Re: I must be missing
glenn andreas <gandrea  2008-05-25 18:53:55 
Re: Questions about memory management (was Re: I must be missing
Gregory Weston <uce@[E  2008-05-24 08:57:32 
Re: I must be missing something... (Categories)
Matthias Benkard <usen  2008-05-14 15:26:05 
Re: I must be missing something... (Categories)
Matthias Benkard <mulk  2008-05-13 12:20:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Oct 10 19:58:52 CDT 2008.