Tagged Questions
-2
votes
2answers
47 views
How to separate the sentence into words?
split the sentence into words with out using "componentsSeparatedByString:"
my word is "This is a well known simple"
I wrote like this separtedWord=[noteTextView.text componentsSeparatedByString: @" ...
0
votes
1answer
26 views
Creating new NSStrings for each item in a plist array
I am attempting to create a class that takes each item in a Plist array and assigns them to an NSString for use in other classes in the program. Here's what I have so far:
NSString *appBundlePath = ...
0
votes
2answers
30 views
How do I easily separate a set of strings stored in a larger NSString?
I had a UILabel with the following text:
Medium, Black
What I intended to do was grab the words in the string and insert each into a mutable array so I could use each title later on to identify ...
3
votes
3answers
62 views
How do I easily strip just a comma from an NSString?
I have a UILabel with the following text:
Medium, Black
What I intended to do was grab the words in the string and insert each into a mutable array so I could use each title later on to identify ...
0
votes
3answers
40 views
NSPredicate to filter between two dates of NSString type
I've some data (as NSDictionary in an NSMutableArray), a sample data is like,
Consider each row as NSDictionary and entire table is an NSMutableArray contains events.
I want to result between two ...
0
votes
0answers
12 views
Social Action Sheet and sharing mulitple pieces of data
i am really confused on how to share multiple pieces of data using the Social Action Sheet! I'm still a beginner, so any help would be awesome!
This is my code for the Button Action:
...
1
vote
3answers
76 views
Objective-C: How to find the most common string in an array?
I have an array of strings from an online database that I trying to determine the most commonly used word. The values inside the arrays will vary but I want to check the most common words of whatever ...
1
vote
3answers
46 views
Remove Duplicated Words From NSString and Save as New NSString
I have scenarios in which I may have an NSString that contains several words, some of them duplicated. What I want to do is take a string that looks like:
One Two Three Three Three Two Two Two One ...
0
votes
2answers
46 views
set label text equal to array value
In the myProj.h file I have declared:
@property (strong, nonatomic) NSMutableArray *wordsArray;
in the .m file I use the following to add some values in viewDidLoad:
[_wordsArray ...
-2
votes
1answer
40 views
NSArray stringByAppendingString
I need to append String by adding an array of Suit to an array of Rank, something like this.
-(NSString *)contents {
return [NSString stringWithFormat:@"%d %@", self.rank, self.suit];
}
The ...
0
votes
2answers
25 views
KVC get lastPathComponent from string which is the property of object
I have e.g. 5 MyFile objects in my NSArray. Each of these 5 objects has property path.
MyFile *myFile ...;
NSString path = myMyFile.path;
So using KVC I can get the properties form all my 5 ...
0
votes
0answers
82 views
Create custom NSString from JSON Array using Mantle
I am using Mantle to parse some business JSON. At present we go through an array of JSON objects for the business categories with the following:
NSMutableString *stringCats = [[NSMutableString ...
0
votes
3answers
76 views
Predicate for range of NString in a Array
I have an array(NSArray) let's say
NSArray *cityArry = @[@"Chennai", @"Mumbai", @"Kolkata"];
For example I have mentioned the NSArray with 3 objects, but actually in runtime I have an array which ...
0
votes
2answers
40 views
Verify if an NSString object's text is contained in a collection of strings (a domain)
Rather than a long if statement, what is a more compact and readable way to verify if a string is contained in a collection of possible values? In other words, check if a value is within a domain?
I ...
1
vote
2answers
65 views
Display edited NSString in order
I have been working on this for a few days with help from this great community.
I have a NSArray that I need to edit NSStrings within. I have managed to detect a marker in the string and make it ...
0
votes
1answer
18 views
First element in NSArray created from NSString starts with a newline
In the following code, I am passing an array that looks like this:
(
AAAA|BBBBB|CCCCC|DDDDD|EEEEE
)
This is just an element of another array.
I need to extract the first component of this element ...
0
votes
2answers
85 views
Using NSScanner to separate string into NSArray by comma
Does anyone know how i can use NSScanner to separate a string by comma into an array EXCEPT when a comma is embedded within quotes?
Before i had been using:
NSArray *arrData = [strData ...
1
vote
2answers
112 views
NSPredicate search in NSArray containing NSArrays with custom objects
I have an NSArray called groups containing NSArray objects which each contain QuestionSub objects, which in its turn inherit from the Question class.
The Question class consist of, amongst others, an ...
0
votes
1answer
99 views
Objective-C: Splitting a word into an array of characters
Sorry for the rather simple question but I'm pretty new to objective-c and can't seem to find a solution to my problem that actually works with what i'm trying to do.
Essentially, I have a NSString ...
0
votes
0answers
33 views
show NSArray - Number type items to cell view
I have an Array and which has number and string items like product names and prices.
cell.textLabel.text = [[mainList objectAtIndex:indexPath.row] objectForKey:@"Adi"];
cell.detailTextLabel.text = ...
-1
votes
1answer
58 views
Make An Array Of Strings
I have a bunch of strings that are used in my search predicate -- I want to put them into an array and search the array rather than searching them individually because searching them individually is ...
0
votes
1answer
19 views
How would I best use componentsSeparatedByCharacterSet but keep the separator/delimiter attached to the first word?
Say I have the following sentence:
I am a sentence that has hyphenated-words at some-points in it.
And I have the following code:
NSCharacterSet *separators = [NSCharacterSet ...
0
votes
0answers
54 views
Json mapping with variables Objective-C
im mapping this Json:
{
"status": "ok",
"count": 4,
"count_total": 4,
"pages": 1,
"posts": [
{
"id": 220,
"type": "products",
"slug": ...
0
votes
2answers
139 views
appendString NSString stringWithFormat not passing values
I have an app which is connected to a database via php, Im trying to send some large data to the database e.g. a list of coordinates
"37.351701,-122.105898",
"37.351945,-122.106109",
...
0
votes
2answers
37 views
How can i separate these strings in iOS
Below is a sample data received using Json serialization
(
1c581b4a4ec43727,
39e0ec2adcf8bae4,
3a66203c191d9016,
3de3d080a7f1ae38
)
I tried using:
NSArray *myVoucherCodes = [[NSArray alloc]init];
...
-4
votes
1answer
93 views
How to break up a string into two pieces from an array in ios?
The arrays are images and I need to add the sound array with it so I can show it in a button and when the button is clicked it will show the image and play the sound.
I used componentsJoinedByString ...
1
vote
2answers
115 views
Loading local html from an array in xcode
I am attempting to load a locally hosted html file into a webview from an array. it looks something like this
_siteAddresses = [[NSArray alloc]
...
0
votes
2answers
93 views
How to split an NSArray of sorted NSStrings into NSMutableArray of NSMutableArrays
I would like to know how to split an NSArray of alphabetically sorted NSStrings into an NSMutableArray of NSMutableArrays.
For instance say my NSArray looks like this
Alice
Awesome
Bacon
Beef
Hat
...
0
votes
4answers
119 views
Find the highest repeated character in string and the count of the repeated character
I need to get the highest repeated character in string and the count of the repeated character.
For that i stored the each character of the string in the array and using the for loops i got each ...
0
votes
2answers
104 views
Objective-C, making an NSArray of each unique character in an NSString
I've searched around and found several questions answered which were similar to this one, but not exactly the same and I have not been able to get the sample code given in those answers to work for ...
0
votes
1answer
36 views
How to separate an NSString by two special characters?
i have a string and need to split it into multiple strings.
for example this is my string:
#titleone% &apple* #titletwo% &honey*
each time it reads "#" i need it to save the string in an ...
0
votes
2answers
123 views
Need to check if NSArray object contains specific text. [duplicate]
I am performing a method call that places any objects found in the background into an NSArray object called "objects".
When I NSLog the counts property of "objects" it tells me that the array ...
-1
votes
1answer
141 views
Replace array of characters in NSString [closed]
I am trying to replace an array of characters from within an NSString.
For example if we have this string:
NSString *s = @"number one and two and three";
NSArray *A1 = [NSArray ...
1
vote
2answers
120 views
Use value of variable as dynamic code in objective c? [duplicate]
I am having some trouble finding help online which makes me think what I am trying to do may not be possible, but I'll ask anyway! I am new to obj-c and I am only developing for a bit of fun...
I am ...
-3
votes
1answer
114 views
create an NSArray of substrings from a NSString [closed]
I have a NSString that contains numbers and characters. I would like to know the best way to make an NSArray of NSStrings that contain 2 characters each from the main string.
For instance if the ...
0
votes
3answers
146 views
Assign Strings At First Index Of NSArray To NSString
I am trying to find a particular url strings from a string named "newString". I am using the following code to detect the links and save them in an array called "matches". The particular strings i am ...
0
votes
3answers
92 views
Error on JSON parsing
I'm having a problem on parsing a JSON.
That is my code.
-(void)requstJson1:(ASIHTTPRequest *)request
{
jsonResponse = [request responseString];
jsonDic = [jsonResponse JSONValue];
...
-1
votes
1answer
340 views
Incompatible pointer types sending 'NSArray' to parameter of type 'NSString'
I'm a newbie. I am trying to call videos from an array. I know I am mixing strings with objects. But I don't know what to replace it with. Here is the [incorrect] line of code:
NSURL *url = [NSURL ...
0
votes
1answer
45 views
How to filter NSArray using two NSPredcates
I would like to filter an NSArray of NSDictionaries, however I would like to filter the result using one, two or even three NSPredicate values?
Currently I am filtering my array by doing this.
...
1
vote
1answer
35 views
UIImage does not download URLs, even though it recognizes the correct amount it should download
I'm having a weird string / array problem. When I count the # of objects in the array (values taken using [string description], it returns two, the correct amount of objects. When I try and download ...
0
votes
2answers
79 views
Scanning for doublets in an array after equating upper and lower case letters
I'm reading in a file, containing words and names, as a string. Then I'm breaking it into an array of strings. What I want to do is to print out the names that are also words. The words are spelled ...
0
votes
2answers
335 views
Loop through block while waiting for previous execution to finish
I have a block of code which loops through an array and performs block code on it. Currently it looks like this:
for (NSString *myString in myArray) {
[self doSomethingToString:myString ...
0
votes
4answers
390 views
Appending zeros to the end of an NSString?
I am having trouble with a code that i narrowed it down to this problem, first of all, reverseString and 2 are both NSMutablestrings _input1 and _input2 are NSStrings, i'm trying to add zeros to the ...
-2
votes
5answers
113 views
Return NSString of objects into an NSMutableArray [closed]
I have the following code to retrieve a list of all the objects inside an NSMutableArray:
NSMutableString *data = [NSMutableString string];
for (Term *term in self.terms)
{
[data appendFormat: ...
0
votes
3answers
123 views
Create a NSString of objects from an NSMutableArray with Core Data [closed]
I have an NSMutableArray with core data objects. I want to create an NSString with these objects formatted in this way:
Keyword - Definition
Keyword - Definition
Keyword - Definition
I ...
0
votes
3answers
60 views
How to look for possible strings in a NSArray?
I have a NSArray of NSStrings, and what I want to do is for example looking for the 8-characters strings with a R as the first char and a A as the third one.
In SQL I would do like this :
SELECT ...
0
votes
1answer
215 views
Convert NSString data from sqlite to NSArray
Here is the situation..
I've inserted a whole NSArray in one field of my SQLite table, now I retrieve the data and it becomes a string. How can I convert it into NSArray again?
This is the contents ...
1
vote
1answer
161 views
Efficiently create placeholder template NSString with NSArray of values
I am trying to make a utility method for FMDB which will take an NSArray of values and return a string of placeholders for use in an IN statement based on the number of values in the array.
I can't ...
0
votes
2answers
83 views
Word output based on NSString sequences
What I want to do is take 3 letter word sequences from an NSString, and change them in to corresponding words. EX) AUG = "START", AGC = "Asparagine", etc. My thought was to change the NSString in to ...
0
votes
1answer
54 views
Replacing multiple strings with Objective-C
I am currently doing an experiment where I input text into a UITextField, and the text is searched to see if it has certain strings in it. If it finds the certain text, it should replace it, and send ...