Re: 2Qs
Re: 2Qs
- Subject: Re: 2Qs
- From: Joshua Scott Emmons <email@hidden>
- Date: Sun, 28 May 2006 09:37:17 -0500
1) How do I make a module (sub/function library) in ObjC?
It's not clear (to me at least) from your examples what you're trying
to do here. Do you want group methods in a separate class? Just make
a new set of .h and .m files, add them to the project (using File-
>New File->Objective-C Class in Xcode will do these two steps for
you), and #import the new .h file at the head of the class you'll
actually be using it in. If you want to make a library that you can
dynamically link and reuse, read up on Frameworks:
ttp://tinyurl.com/mebrc
In fact, you might want to read, generally, about adding behavior to
a Cocoa program:
http://tinyurl.com/rblrw
2) What's the default encoding of an NSString literal? I'm guessing
UTF8.
This one was an easy find on Google, by the way. You might want to
try STFW.
Anyway, http://tinyurl.com/gu2lh says that:
@"string" Defines a constant NSString object in the current
module and initializes the object with the specified 7-bit
ASCII-encoded string.
See also: @encode() and +[NSString stringWithUTF8String:]
And how do I append (concatenate) a character (double-quote - ASCII
value of 34) to an NSString?
For most purposes, I would think you'd be able to do:
myString = [myString stringByAppendingString:@"\""];
Is there a reason this won't work for you?
Cheers,
-Joshua Emmons
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >2Qs (From: William Squires <email@hidden>) |