nsstring Questions
9
Solved
I have been stuck with this for a while and don't seem to get around this.
I am trying to read the contents of an URL as a string from an URL, But i get a weird
Error -> Error Domain=NSCocoaE...
3
Solved
I am currently using
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(UILineBreakMode)lineBreakMode
to get the size of an NSString. However, when that string ...
Paddlefish asked 12/4, 2013 at 7:29
9
Solved
I try to detect when carriage goes at new line in UITextView. I can detect it by comparison total later width with UITextView width:
CGSize size = [textView.text sizeWithAttributes:textView.typing...
Cuddy asked 15/11, 2013 at 19:7
5
Solved
I am trying to find the accepted formats on an AVFoundation output:
self.theOutput=[[AVCaptureVideoDataOutput alloc]init];
if ([self.theSession canAddOutput:self.theOutput])
[self.theSession add...
Mesnalty asked 26/1, 2013 at 14:33
1
There are several threads on how to replicate NSString's boolValue method, but most are guesses or simplifications.
Apple only gives us this brief descriptions:
This property is YES on encounterin...
11
Solved
I'm developing an iPhone app. In a label, I want to show an user's first letter of the name uppercase. How do I do that?
Dietetic asked 26/1, 2012 at 17:8
31
Solved
I am implementing push notifications. I'd like to save my APNS Token as a String.
- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDev...
Atropos asked 21/2, 2012 at 5:48
4
Solved
I just migrated our project to swift 3 and see lots of crashes because of one issue:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue pointSize]: unre...
19
Solved
How can we check if a string is made up of numbers only. I am taking out a substring from a string and want to check if it is a numeric substring or not.
NSString *newString = [myString substringW...
Monkery asked 22/5, 2011 at 23:4
3
Solved
Say I have a string:
NSString *state = @"California, CA";
Can someone please tell me how to extract the last two characters from this string (@"CA" in this example).
Alack asked 14/8, 2010 at 12:17
11
Solved
I just started learning Swift. I have got my code to read from the text file, and the App displays the content of the entire text file. How can I display line by line and call upon that line multip...
4
I'm confused on how to use SF Symbols in text in an iOS project. I have a UIButton that uses a symbol just fine using UIImage systemImageNamed:. I would like to display a message about that button ...
Christianize asked 11/10, 2019 at 12:12
2
Solved
I'm looking for a good way in Objective-C to replace the last comma in a string with the word "and". Any suggestions?
"Red, Green, Blue, Yellow"
becomes
"Red, Green, Blue and Yellow"
Leaved asked 10/4, 2011 at 20:43
8
Solved
Simple and may asked many time but little trick with this. We know, NSString doesn't work with case sensitivity for hasPrefix: method.
NSString *string = @"Xyzabcdedfghij";
NSString *substring = ...
Stillas asked 24/2, 2014 at 12:47
2
Solved
I'm wondering, is there a way to do half of a new line character (\n) in an NSString in objective C, i.e. so that it only skips about half the space? Or anyway else to accomplish this in an NSStrin...
Guzel asked 12/8, 2013 at 9:52
12
Solved
I have a URL in an iPhone application to work with. But the problem is that it has some spaces in the URL. I want to replace the spaces with '%20'. I know that there are the stringByReplacingOccure...
Damiendamietta asked 9/8, 2010 at 12:13
12
In my app, I have a string like:
"3022513240"
I want to convert this like:
(302)-251-3240
How can I solve this?
Trask asked 20/2, 2013 at 7:19
15
Solved
I need to create a String with format which can convert Int, Int64, Double, etc types into String. Using Objective-C, I can do it by:
NSString *str = [NSString stringWithFormat:@"%d , %f, %ld,...
Finney asked 6/6, 2014 at 5:0
8
Solved
I'm using very tricky fighting methods :) to make a string like Fi?le*/ Name safe for using as a file name like File_Name.
I'm sure there is a cocoa way to convert it. And I'm sure the best place ...
8
Solved
Possible Duplicate:
How can I compare two dates, return a number of days
I have two dates (as NSString in the form "yyyy-mm-dd"), for example:
NSString *start = "2010-11-01";
NSString *end...
Chamberlain asked 1/1, 2011 at 20:42
5
Solved
I would like to loop through an NSString and call a custom function on every word that has certain criterion (For example, "has 2 'L's"). I was wondering what the best way of approaching that was. ...
Mer asked 23/6, 2012 at 16:14
3
Solved
I noticed that iOS 7 introduces new classes related to text layout such as NSLayoutManager, NSTextStorage, and NSTextContainer. How can I use these in order to get information about word wrapping o...
Lowenstern asked 25/10, 2013 at 22:28
6
Solved
I've been trying to apply combinations of NSFontAttributes to NSMutableAttributedString's lately and I simply can't find a thorough explanation on how to do it without removing other attributes.
...
Wriest asked 28/12, 2015 at 19:45
30
Solved
How do I test if an NSString is empty in Objective-C?
Smitten asked 22/5, 2009 at 18:12
5
Solved
If I do the following in Objective-C:
NSString *result = [NSString stringWithFormat:@"%1.1f", -0.01];
It will give result @"-0.0"
Does anybody know how I can force a result @"0.0" (without the ...
Crockett asked 10/6, 2012 at 14:15
1 Next >
© 2022 - 2025 — McMap. All rights reserved.