NSString * theString=@"e88d";
NSData * data;
// something I should implement
NSLog(@"%@", theString);
NSLog(@"%@",[data description]);
I want the results of the two printings are the same.
AES encryption and decryption:
(1).The server:
if the plaintext is :@"abcd";
the AES encrypted data(NSData data type) is :"d882830c dc892...
Hi, I'm trying to save the contents of an UITextView into a NSString which I will somehow persist later.
The problem is that the UITextView "text" property doesn't save all the rows in the textView (after touching "return"). I tried print the TextView object and the textView.text, and they're different.
Does anybody know how (after edi...
I've already found how to capitalize all words of the sentence, but not the first word only.
NSString *txt =@"hi my friends!"
[txt capitalizedString];
I don't want to change to lower case and capitalize the first char. I'd like to capitalize the first word only without change the others.
...
I am having code
NSString *cellValue1 = [products1 objectAtIndex:indexPath.row];
when i try to print NSLog(@"cell value is %@",cellValue1);
in log i am not getting anything,
if i use %s, i am getting some symbols, not the string located in cellValue1.
Please help me.
Thanks in advance.
...
I have a 'Contact' class with two properties : firstName and lastName.
When I want to display a contact's full name, here is what I do:
NSString *fullName = [NSString stringWithFormat:@"%@ %@", contact.firstName, contact.lastName];
But when the firstName and/or lastName is set to nil, I get a "(null)" in the fullName string. To preven...
For one NSString, I have N pattern strings. I'd like to extract substrings "around" the pattern matches.
So, if i have "the quick brown fox jumped over the lazy dog" and my patterns are "brown" and "lazy" i would like to get "quick brown fox" and "the lazy dog." However, the substrings don't necessarily need to be delimited by whitesp...
I want to know the width of an NSString displayed on the screen in pixels. So I can fit an NSTextField its bounds to be exactly the length of the string itself. So I used IB's "Label" NSTextField and for those who don't know what I mean, I got a label with title "Label", font "Lucida Grande 13px", not selectable, not editable, regular si...
Hi,
I have a UIWebView that loads a link, http://www.google.com/a/datacommsales.net. But I want to have the datacommsales.net part interchangable. What I would like it to be is http://www.google.com/a/stringOne, stringOne being the NSString, so I can set the value of the string and change the link without editing the code. But the link i...
I have the next problem. In one of the cells (UITableViewCell) I need to show quite a long string. I am trying to break it in lines (adding \n) between words, but it does not seem to help (to be precise -- the string has \n, but it still shows like "My long string very..." in the cell) How do I do this properly?
...
I am new to cocoa. I have been working on these stuff for a few days.
For the following code, i can read all the data in the string, and successfully get the data for plot.
NSMutableArray *contentArray = [NSMutableArray array];
NSString *filePath = @"995,995,995,995,995,995,995,995,1000,997,995,994,992,993,992,989,988,987,990,993,989...
A quick question, for a quick answer (since I'm not finding any):
Is there a way to change the font of the section's title (given by titleForSection) in iPhone?
Thanks a lot!
...
I'm trying to take the output of arc4sin and put it into a label.
(EDIT: You can ignore this and just post sample code, if this is too irrelevant.)
I've tried:
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
NSString *number = [[NSString...
Hi there.
I have an NSData object which I am trying to turn into an NSString using the following line of code:
NSString *theData = [[NSString alloc] initWithData:photo encoding:NSASCIIStringEncoding];
Unfortunately I am getting the following result, instead of my desired binary output (can I expect a binary output here?);
ÿØÿà
I'd...
Does anyone know how to use line breaks in NSString? I need to do something like this -
[NSString stringWithFormat:@"%@,\n%@", mystring1,mystring2];
...
How would I get returningResponse (into say, a NSString) from the following code:
NSURLResponse* response;
NSError* error;
NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
I think I can get the info that I need into a string but I can't call anything on response because it'...
My task boils down to extracting the range of characters in a given line of a multiline UILabel. These lines are the lines that appear where the UILabel breaks to fit to width: in other words, not separated by hard line breaks. This seem to rule out lineRangeForRange:. Or am I wrong?
Context : I have an iPhone game where a user taps UIL...
I've seen this post: http://stackoverflow.com/questions/2035567/nsstring-newline-escape-in-plist but I'd like to know if there's a way to pragmatically render \n line breaks.
I'm currently using:
decisionText.text = [NSString stringWithFormat: (@"%@", [replies objectAtIndex:(arc4random() % [replies count])])];
Which randomly grabs a ...
Hi,
I have utf8 encoded nsdata from windows server. I want to convert it to nsstring for iphone. Since data contains characters(like degree symbol) which have different values on both platforms, how do I convert data to string.
...
I want to check to see if an array has "-" to activate a shipping method. I put "-" in since the array value will aways =2 and I need to IF ELSE by the contents. If the user doesn't not enter an address in the contents of the array looks like this:
Root Array (2items)
Item 1 String -
Item 2 String -
Here is the code for ...
I'm trying to write an IF ELSE statement to enable shipping, If user doesn't add an address the array contents remain as "-" & "-" for the two items in the array. I want to check to see if those are in the array, if they are then I want to enableshipping.
Here is the code for getting the array:
NSArray *paths = NSSearchPathForDirector...