NSLog() what is it?
NSLog() what is it?
- Subject: NSLog() what is it?
- From: Michael Zornek <email@hidden>
- Date: Sat, 22 Jun 2002 02:55:24 -0400
Hi everyone! First post to the list!
I'm in ch 6 of Learning Cocoa (where we are building Cocoa Foundation Tools)
and it tells me to use NSLog all over the place but when I went to option
click it for documentation it wasn't there. After some more directed
searching I couldn't find it ether.
My main is below, and here are my questions:
1) Is NSLog() an object? If so, why does option clicking it not return
information?
2) Where is info. In particular the book tells us to use the following line
to get the value inside of an array:
>
NSLog(@"Array desctiption: %@ items.\n", myArray);
But when I try to out my "itemcount" in a similar fashion:
>
NSLog(@itemcount);
-or-
>
NSLog(itemCount);
It get errors :-(
I think in general I'm looking to replicate something similar to this C++
code that I've been writing.
cout << "The number of items in my array are: " << itemCount << endl;
thanks in adv. for all your help,
~ Mike, a lowely web guy working his way into platform coding.
My main:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
// init
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSMutableArray *myArray;
NSString *myString;
int itemCount;
// start code
NSLog(@"Hello, World!");
myArray = [[NSMutableArray alloc] init];
NSLog(@"Array desctiption: %@ items.\n", myArray);
[myArray addObject: @"Here's a string!"];
[myArray addObject: @"Here's a another string!"];
NSLog(@"Array desctiption: %@ items.\n", myArray);
itemCount = [myArray count];
// NSLog(@itemcount);
// NSLog(itemCount);
[myArray release];
[pool release];
return 0;
}
--
Mike Zornek | Project Leader
Apple Student Developers
The Insanely Great Site with the Insanely Long URL
http://www.applestudentdevelopers.org
Personal Site:
http://www.mikezornek.com
_______________________________________________
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.